diff options
| author | 2010-08-19 16:13:51 +0000 | |
|---|---|---|
| committer | 2010-08-19 16:13:51 +0000 | |
| commit | 05702c5f0736de0b3f81853ae7130e31c273d1f5 (patch) | |
| tree | 3f5abb953745c49172d54e21d312ed5b7edee5d3 /src/lib | |
| parent | 97c9264e2fbba2368285717f5401701276a5f384 (diff) | |
Added basic comparison operators to the astring class.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/util/astring.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h index e41466536a0..02f102c0a73 100644 --- a/src/lib/util/astring.h +++ b/src/lib/util/astring.h @@ -316,6 +316,19 @@ public: astring &operator=(const char *string) { return cpy(string); } astring &operator=(const astring &string) { return cpy(string); } + + bool operator==(const char *string) const { return (cmp(string) == 0); } + bool operator==(const astring &string) const { return (cmp(string) == 0); } + bool operator!=(const char *string) const { return (cmp(string) != 0); } + bool operator!=(const astring &string) const { return (cmp(string) != 0); } + bool operator<(const char *string) const { return (cmp(string) < 0); } + bool operator<(const astring &string) const { return (cmp(string) < 0); } + bool operator<=(const char *string) const { return (cmp(string) <= 0); } + bool operator<=(const astring &string) const { return (cmp(string) <= 0); } + bool operator>(const char *string) const { return (cmp(string) > 0); } + bool operator>(const astring &string) const { return (cmp(string) > 0); } + bool operator>=(const char *string) const { return (cmp(string) >= 0); } + bool operator>=(const astring &string) const { return (cmp(string) >= 0); } astring &reset() { return cpy(""); } astring &expand(int length) { astring_expand(this, length); return *this; } |
