diff options
author | Paul Gilbert | 2016-11-30 21:30:50 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-11-30 21:30:50 -0500 |
commit | 51a208b00d884bca2145c65f39b4ac4974dee4a7 (patch) | |
tree | e1eec78c5b97621c9c6deeb03fcd5ebd4a371831 /engines/titanic/support | |
parent | 77d51dcbe403e699985b6bef0334ca725340aef5 (diff) | |
download | scummvm-rg350-51a208b00d884bca2145c65f39b4ac4974dee4a7.tar.gz scummvm-rg350-51a208b00d884bca2145c65f39b4ac4974dee4a7.tar.bz2 scummvm-rg350-51a208b00d884bca2145c65f39b4ac4974dee4a7.zip |
TITANIC: Fix getting Succubus's NPC script
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/string.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/support/string.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp index cf1b29b6ec..6687c24321 100644 --- a/engines/titanic/support/string.cpp +++ b/engines/titanic/support/string.cpp @@ -77,6 +77,15 @@ int CString::lastIndexOf(char c) const { return charP ? charP - c_str() : -1; } +bool CString::containsIgnoreCase(const CString &str) const { + CString lowerStr = *this; + CString subStr = str; + lowerStr.toLowercase(); + subStr.toLowercase(); + + return lowerStr.contains(subStr); +} + FileType CString::fileTypeSuffix() const { CString ext = right(1); if (ext == "0" || ext == "4") diff --git a/engines/titanic/support/string.h b/engines/titanic/support/string.h index 71242c01c9..5ea70dbeca 100644 --- a/engines/titanic/support/string.h +++ b/engines/titanic/support/string.h @@ -96,6 +96,11 @@ public: int lastIndexOf(char c) const; /** + * Returns true if the string contains a specified substring, ignoring case + */ + bool containsIgnoreCase(const CString &str) const; + + /** * Returns the type of a filename based on it's extension */ FileType fileTypeSuffix() const; |