diff options
author | Einar Johan Trøan Sømåen | 2012-07-09 04:17:28 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-09 04:17:28 +0200 |
commit | 01d6ff21212a2d323717a3a1dc9e7b72cdd6adb7 (patch) | |
tree | ffa8808ad59b6482e8f66cc0c1fa71ba67b1a237 /engines/wintermute/utils/StringUtil.cpp | |
parent | 7c984d24a8cd2ebe5a7860e21cda392edada34b3 (diff) | |
download | scummvm-rg350-01d6ff21212a2d323717a3a1dc9e7b72cdd6adb7.tar.gz scummvm-rg350-01d6ff21212a2d323717a3a1dc9e7b72cdd6adb7.tar.bz2 scummvm-rg350-01d6ff21212a2d323717a3a1dc9e7b72cdd6adb7.zip |
WINTERMUTE: Cleanup and simplify StringUtil a bit.
Diffstat (limited to 'engines/wintermute/utils/StringUtil.cpp')
-rw-r--r-- | engines/wintermute/utils/StringUtil.cpp | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/engines/wintermute/utils/StringUtil.cpp b/engines/wintermute/utils/StringUtil.cpp index 53ad4c8add..c5ad025939 100644 --- a/engines/wintermute/utils/StringUtil.cpp +++ b/engines/wintermute/utils/StringUtil.cpp @@ -34,34 +34,8 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-void StringUtil::toLowerCase(AnsiString &str) {
- str.toLowercase();
-}
-
-//////////////////////////////////////////////////////////////////////////
-/*void StringUtil::toLowerCase(WideString &str) {
- std::transform(str.begin(), str.end(), str.begin(), ::towlower);
-}*/
-
-//////////////////////////////////////////////////////////////////////////
-void StringUtil::toUpperCase(AnsiString &str) {
- str.toUppercase();
-}
-
-//////////////////////////////////////////////////////////////////////////
-/*void StringUtil::toUpperCase(WideString &str) {
- std::transform(str.begin(), str.end(), str.begin(), ::towupper);
-}*/
-
-//////////////////////////////////////////////////////////////////////////
bool StringUtil::compareNoCase(const AnsiString &str1, const AnsiString &str2) {
- AnsiString str1lc = str1;
- AnsiString str2lc = str2;
-
- toLowerCase(str1lc);
- toLowerCase(str2lc);
-
- return (str1lc == str2lc);
+ return (str1.compareToIgnoreCase(str2) == 0);
}
//////////////////////////////////////////////////////////////////////////
@@ -369,33 +343,21 @@ int StringUtil::lastIndexOf(const WideString &str, const WideString &toFind, siz //////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::toString(size_t val) {
- /* std::ostringstream str;
- str << val;
- return str.str();*/
return Common::String::format("%u", (uint32)val);
}
//////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::toString(int val) {
- /* std::ostringstream str;
- str << val;
- return str.str();*/
return Common::String::format("%d", val);
}
//////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::toString(float val) {
- /* std::ostringstream str;
- str << val;
- return str.str();*/
return Common::String::format("%f", val);
}
//////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::toString(double val) {
- /* std::ostringstream str;
- str << val;
- return str.str();*/
return Common::String::format("%f", val);
}
|