summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-18 20:14:23 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-18 20:16:53 +0100
commit7e43b82e3b7cda034fab34c15ecfaa97c1a99146 (patch)
tree71e24c3ef685d95b8fdf6c548a46b8516915d339 /src/resources
parent9568a305878d0c035e027c1ed6c9a24147a0adea (diff)
downloadmana-7e43b82e3b7cda034fab34c15ecfaa97c1a99146.tar.gz
mana-7e43b82e3b7cda034fab34c15ecfaa97c1a99146.tar.bz2
mana-7e43b82e3b7cda034fab34c15ecfaa97c1a99146.tar.xz
mana-7e43b82e3b7cda034fab34c15ecfaa97c1a99146.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.cpp9
-rw-r--r--src/resources/mapreader.cpp2
2 files changed, 3 insertions, 8 deletions
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;