summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-12 17:02:17 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-12 17:02:17 +0200
commit992c2920f7e1940aa293e27cf4ea7ec23668a673 (patch)
tree4328076c6585a015433cb8bb763eab687da675bc /src/utils/stringutils.cpp
parent428770c113abf002e5cc0b79ae872db1f26cf283 (diff)
downloadplus-992c2920f7e1940aa293e27cf4ea7ec23668a673.tar.gz
plus-992c2920f7e1940aa293e27cf4ea7ec23668a673.tar.bz2
plus-992c2920f7e1940aa293e27cf4ea7ec23668a673.tar.xz
plus-992c2920f7e1940aa293e27cf4ea7ec23668a673.zip
Add items attribute what allow hide other sprites only by id.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index ffce9897e..99316ce32 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -364,3 +364,14 @@ std::string normalize(const std::string &name)
std::string normalized = name;
return toLower(trim(normalized));
}
+
+std::set<int> splitToIntSet(const std::string &text, char separator)
+{
+ std::set<int> tokens;
+ std::stringstream ss(text);
+ std::string item;
+ while(std::getline(ss, item, separator))
+ tokens.insert(atoi(item.c_str()));
+
+ return tokens;
+}