From 7e43b82e3b7cda034fab34c15ecfaa97c1a99146 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 18 Feb 2009 20:14:23 +0100 Subject: Introduced a toLower method and grouped string utils The string utility methods are now grouped together in the stringutils.h header. Also, a toLower method was added for convenience. --- src/resources/itemdb.cpp | 9 ++------- src/resources/mapreader.cpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/resources') diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 577b9947..fec52150 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -29,7 +29,7 @@ #include "../utils/dtor.h" #include "../utils/gettext.h" -#include "../utils/trim.h" +#include "../utils/stringutils.h" #include "../utils/xml.h" namespace @@ -124,12 +124,7 @@ void ItemDB::load() if (itr == mNamedItemInfos.end()) { std::string temp = name; - trim(temp); - - for (unsigned int i = 0; i < temp.size(); i++) - { - temp[i] = (char) tolower(temp[i]); - } + toLower(trim(temp)); mNamedItemInfos[temp] = itemInfo; } diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 53df40c3..5fa47261 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -33,7 +33,7 @@ #include "../tileset.h" #include "../utils/base64.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" #include "../utils/xml.h" const unsigned int DEFAULT_TILE_WIDTH = 32; -- cgit v1.2.3-70-g09d2