File: mystring.cc

package info (click to toggle)
nullmailer 1%3A1.03-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,524 kB
  • ctags: 695
  • sloc: cpp: 4,484; sh: 4,123; makefile: 224; perl: 184
file content (28 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);