diff options
| author | 2010-08-21 19:23:48 +0000 | |
|---|---|---|
| committer | 2010-08-21 19:23:48 +0000 | |
| commit | 0e09afc1a814682a1d9ea5eb70d8f6fc5a708f33 (patch) | |
| tree | f66a12b68688651b9268b25acf60583134544997 /src/lib | |
| parent | 5f6ba3ed9c43a289c6420bd322d9c40ea27c81a0 (diff) | |
Added bool operator to astring, returning true if the string is
not empty. Conveniently, this creates ambiguity if you write
astring == NULL. Rooted out remaining cases where we were doing
that and fixed them.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/util/astring.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h index 02f102c0a73..e38d2d7fe71 100644 --- a/src/lib/util/astring.h +++ b/src/lib/util/astring.h @@ -333,6 +333,7 @@ public: astring &reset() { return cpy(""); } astring &expand(int length) { astring_expand(this, length); return *this; } + operator bool() const { return this->text[0] != 0; } operator char *() { return this->text; } operator const char *() const { return astring_c(this); } const char *cstr() const { return astring_c(this); } |
