diff options
Diffstat (limited to 'lib/mystring/mystring.cc')
-rw-r--r-- | lib/mystring/mystring.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/mystring/mystring.cc b/lib/mystring/mystring.cc new file mode 100644 index 0000000..c04bf2f --- /dev/null +++ b/lib/mystring/mystring.cc @@ -0,0 +1,28 @@ +#include "mystring.h" +#include "trace.h" +#include <ctype.h> +#include <string.h> + +#ifdef MYSTRING_TRACE +mystring::~mystring() +{ + trace("rep=" << (void*)rep); + rep->detach(); +} +#endif + +int mystring::operator!=(const char* in) const +{ + if(rep->buf == in) + return 0; + return strcmp(rep->buf, in); +} + +int mystring::operator!=(const mystring& in) const +{ + if(rep->buf == in.rep->buf) + return 0; + return strcmp(rep->buf, in.rep->buf); +} + +const mystring mystring::NUL("", 1); |