summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-14 03:54:55 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-14 23:52:45 +0200
commit3805d1384894a33ecb09e4852d47afb04ddb0687 (patch)
tree840b5920d912576554e0e11e67794a726d4a9c4f /src/utils
parent36ccecd553539955929f1ce535b8925533922e4e (diff)
downloadManaVerse-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.gz
ManaVerse-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.bz2
ManaVerse-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.xz
ManaVerse-3805d1384894a33ecb09e4852d47afb04ddb0687.zip
Replace sprites functionality (need support in client data).
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp11
-rw-r--r--src/utils/stringutils.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 99316ce32..357938fb8 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -375,3 +375,14 @@ std::set<int> splitToIntSet(const std::string &text, char separator)
return tokens;
}
+
+std::list<int> splitToIntList(const std::string &text, char separator)
+{
+ std::list<int> tokens;
+ std::stringstream ss(text);
+ std::string item;
+ while(std::getline(ss, item, separator))
+ tokens.push_back(atoi(item.c_str()));
+
+ return tokens;
+}
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 934c0f82d..a69d30914 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -167,4 +167,6 @@ std::string normalize(const std::string &name);
std::set<int> splitToIntSet(const std::string &text, char separator);
+std::list<int> splitToIntList(const std::string &text, char separator);
+
#endif // UTILS_STRINGUTILS_H