summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-08-19 16:13:51 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-08-19 16:13:51 +0000
commit05702c5f0736de0b3f81853ae7130e31c273d1f5 (patch)
tree3f5abb953745c49172d54e21d312ed5b7edee5d3 /src/lib
parent97c9264e2fbba2368285717f5401701276a5f384 (diff)
Added basic comparison operators to the astring class.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/astring.h13
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; }