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.14 by root, Mon Apr 23 16:07:00 2007 UTC vs.
Revision 1.15 by root, Mon May 14 21:52:32 2007 UTC

29 } 29 }
30 30
31 int length () const 31 int length () const
32 { 32 {
33 return length (s); 33 return length (s);
34 }
35
36 // returns wether this shared string begins with the given prefix,
37 // used mainly for searched when users give only the start of a name.
38 bool begins_with (const char *prefix) const
39 {
40 int plen = strlen (prefix);
41 return !strncasecmp (s, prefix, plen) && length () >= plen;
34 } 42 }
35 43
36 static const char *find (const char *s); 44 static const char *find (const char *s);
37 static const char *intern (const char *s); 45 static const char *intern (const char *s);
38 46

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines