--- deliantra/server/include/shstr.h 2007/04/23 16:07:00 1.14 +++ deliantra/server/include/shstr.h 2007/05/14 21:52:32 1.15 @@ -33,6 +33,14 @@ return length (s); } + // returns wether this shared string begins with the given prefix, + // used mainly for searched when users give only the start of a name. + bool begins_with (const char *prefix) const + { + int plen = strlen (prefix); + return !strncasecmp (s, prefix, plen) && length () >= plen; + } + static const char *find (const char *s); static const char *intern (const char *s);