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.22 by root, Tue May 6 16:55:26 2008 UTC vs.
Revision 1.23 by root, Sun Dec 28 06:59:27 2008 UTC

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