diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-18 20:14:23 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-18 13:19:11 -0700 |
commit | c3f7f72f37adad5103587069ff549798fc9d652d (patch) | |
tree | df268b0bfd478cb3f4d740b1bce9a882bc70c538 /src/resources | |
parent | b8f0e1755ae8c6acf9bc681a83f18ef6ff0a1172 (diff) | |
download | mana-c3f7f72f37adad5103587069ff549798fc9d652d.tar.gz mana-c3f7f72f37adad5103587069ff549798fc9d652d.tar.bz2 mana-c3f7f72f37adad5103587069ff549798fc9d652d.tar.xz mana-c3f7f72f37adad5103587069ff549798fc9d652d.zip |
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.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/itemdb.cpp | 9 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index ceaf0395..0031bbd0 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -30,7 +30,7 @@ #include "../utils/dtor.h" #include "../utils/gettext.h" -#include "../utils/trim.h" +#include "../utils/stringutils.h" #include "../utils/xml.h" namespace @@ -125,12 +125,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 840f0677..901a2561 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -34,7 +34,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; |