diff options
author | Max Horn | 2004-07-21 14:20:37 +0000 |
---|---|---|
committer | Max Horn | 2004-07-21 14:20:37 +0000 |
commit | 0605918ab412f3424450f11f8582dfb4c4940208 (patch) | |
tree | afe5702152e37d249bd2037b1fc11cca99ac7084 /common/str.h | |
parent | 9dfee6c315aa2908002bc800adb706e5f070f08c (diff) | |
download | scummvm-rg350-0605918ab412f3424450f11f8582dfb4c4940208.tar.gz scummvm-rg350-0605918ab412f3424450f11f8582dfb4c4940208.tar.bz2 scummvm-rg350-0605918ab412f3424450f11f8582dfb4c4940208.zip |
Small tweaks for the String class
svn-id: r14293
Diffstat (limited to 'common/str.h')
-rw-r--r-- | common/str.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/str.h b/common/str.h index d6354481d5..704a03a4d6 100644 --- a/common/str.h +++ b/common/str.h @@ -70,6 +70,7 @@ public: uint size() const { return _len; } bool isEmpty() const { return (_len == 0); } + char lastChar() const { return (_len > 0) ? _str[_len-1] : 0; } }; class String : public ConstString { @@ -94,6 +95,7 @@ public: // An alternative would be to add private clone() and cloneMutable methods that // would do the right thing. String &operator =(const String &str); + String &operator =(char c); String &operator +=(const char *str); String &operator +=(const String &str); String &operator +=(char c); @@ -108,7 +110,6 @@ public: return _str[idx]; } - char lastChar() const; void deleteLastChar(); void deleteChar(int p); void clear(); |