diff options
author | Paul Gilbert | 2016-08-20 15:11:07 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-20 15:11:07 -0400 |
commit | 04242118ca7bca31aa9659ffceaf80702bc90fb8 (patch) | |
tree | 05b9afd600f97f1d20c2774121512bd4e8f990a4 /engines/titanic/support | |
parent | 1dc8ae58e40c08e1e50cfe8c892b3dac27abdafd (diff) | |
download | scummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.tar.gz scummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.tar.bz2 scummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/string.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/support/string.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp index 1400c25733..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; diff --git a/engines/titanic/support/string.h b/engines/titanic/support/string.h index 487c138358..71242c01c9 100644 --- a/engines/titanic/support/string.h +++ b/engines/titanic/support/string.h @@ -75,6 +75,12 @@ public: CString mid(uint start) const; /** + * Returns a substring consisting of the entire string + * except for a specified number of characters at the end + */ + CString deleteRight(uint count) const; + + /** * Returns the index of the first occurance of a given character */ int indexOf(char c) const; |