--- deliantra/server/include/shstr.h 2006/09/14 21:16:12 1.11 +++ deliantra/server/include/shstr.h 2007/04/23 15:27:46 1.13 @@ -1,6 +1,8 @@ #ifndef SHSTR_H__ #define SHSTR_H__ +#include + #include "util.h" extern int buf_overflow (const char *buf1, const char *buf2, int bufsize); @@ -101,6 +103,24 @@ return sh.length (); } +inline int strcmp (const shstr &a, const shstr &b) +{ + // TODO: use this to find all the occurences of people using strcmp + // all uses should be bogus, as we should be never interested in + // comparing shstr's alphabetically +#if 0 + extern void do_not_use_strcmp_to_compare_shstr_values (); + do_not_use_strcmp_to_compare_shstr_values (); +#endif + return a != b; +} + +std::ostream &operator <<(std::ostream &o, const shstr &sh) +{ + o.write (sh.s, sh.length ()); + return o; +} + // only good for mass comparisons to shstr objects struct shstr_cmp {