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.5 by root, Sun Sep 3 00:18:41 2006 UTC vs.
Revision 1.6 by root, Sun Sep 3 07:57:56 2006 UTC

15 static const char *find (const char *s); 15 static const char *find (const char *s);
16 static const char *intern (const char *s); 16 static const char *intern (const char *s);
17 17
18 static void gc (); // garbage collect a few strings 18 static void gc (); // garbage collect a few strings
19 19
20 // this is used for informational messages and the like I/O 20 // this is used for informational messages and the like
21 const char *operator &() const { return s ? s : "<nil>"; } 21 const char *operator &() const { return s ? s : "<nil>"; }
22 22
23 const char &operator [](int i) { return s[i]; } 23 const char &operator [](int i) const { return s[i]; }
24 operator const char *() const { return s; } 24 operator const char *() const { return s; }
25 25
26 int length () const 26 int length () const
27 { 27 {
28 return s ? *((int *)s - 2) : 0; 28 return s ? *((int *)s - 2) : 0;
31 shstr () 31 shstr ()
32 : s (0) 32 : s (0)
33 { 33 {
34 } 34 }
35 35
36 shstr (shstr &sh) 36 shstr (const shstr &sh)
37 : s (sh.s) 37 : s (sh.s)
38 { 38 {
39 if (s) ++refcnt (); 39 if (s) ++refcnt ();
40 } 40 }
41 41

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines