diff options
Diffstat (limited to 'engines/titanic/support/string.cpp')
-rw-r--r-- | engines/titanic/support/string.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp index cd39c03861..9961cfce59 100644 --- a/engines/titanic/support/string.cpp +++ b/engines/titanic/support/string.cpp @@ -58,6 +58,10 @@ CString CString::mid(uint start) const { return mid(start, strSize - start); } +CString CString::deleteRight(uint count) const { + return (count >= size()) ? CString() : left(size() - count); +} + int CString::indexOf(char c) const { const char *charP = strchr(c_str(), c); return charP ? charP - c_str() : -1; @@ -122,4 +126,20 @@ CString CString::format(const char *fmt, ...) { return output; } +bool CString::operator==(const CString &x) const { + return compareToIgnoreCase(x) == 0; +} + +bool CString::operator==(const char *x) const { + return compareToIgnoreCase(x) == 0; +} + +bool CString::operator!=(const CString &x) const { + return compareToIgnoreCase(x) != 0; +} + +bool CString::operator!=(const char *x) const { + return compareToIgnoreCase(x) != 0; +} + } // End of namespace Titanic |