ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/shstr.h
(Generate patch)

Comparing deliantra/server/include/shstr.h (file contents):
Revision 1.21 by root, Sat May 3 11:14:50 2008 UTC vs.
Revision 1.23 by root, Sun Dec 28 06:59:27 2008 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify 6 * Deliantra is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or 8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
116 s = intern (str); 116 s = intern (str);
117 117
118 return *this; 118 return *this;
119 } 119 }
120 120
121 bool operator ==(const shstr &b)
122 {
123 return s == b.s;
124 }
125
126 bool operator !=(const shstr &b) 121 bool operator !=(const shstr &b)
127 { 122 {
128 return !(*this == b); 123 return !(*this == b);
129 } 124 }
130}; 125};
126
127inline bool operator ==(const shstr &a, const shstr &b)
128{
129 return a.s == b.s;
130}
131 131
132inline int strlen (const shstr &sh) 132inline int strlen (const shstr &sh)
133{ 133{
134 return sh.length (); 134 return sh.length ();
135} 135}
165 shstr_cmp (const shstr_cmp &sh) 165 shstr_cmp (const shstr_cmp &sh)
166 : s (sh.s) 166 : s (sh.s)
167 { 167 {
168 } 168 }
169 169
170 shstr_cmp (const shstr &sh)
171 : s (sh.s)
172 {
173 }
174
175 // this is used for informational messages and the like
176 const char *operator &() const { return s; }
177
170 shstr_cmp &operator =(const shstr_cmp sh) { s = sh.s; return *this; } 178 shstr_cmp &operator =(const shstr_cmp sh) { s = sh.s; return *this; }
171 operator const char *() const { return s; } 179 operator const char *() const { return s; }
172}; 180};
173 181
174inline bool operator ==(const shstr_cmp &a, const shstr &b) 182inline bool operator ==(const shstr_cmp &a, const shstr &b)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines