diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-27 03:35:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-27 03:35:10 +0300 |
commit | 7ed530350226d268c3ccb80952f4176589e9a32a (patch) | |
tree | 05c4d030d2c872ae458fd2606ec116c1a636e8b2 /src/utils | |
parent | 10502e29937b67d5f2d62cf70804a4de76c5cf69 (diff) | |
download | plus-7ed530350226d268c3ccb80952f4176589e9a32a.tar.gz plus-7ed530350226d268c3ccb80952f4176589e9a32a.tar.bz2 plus-7ed530350226d268c3ccb80952f4176589e9a32a.tar.xz plus-7ed530350226d268c3ccb80952f4176589e9a32a.zip |
Autoselect resolution under android.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/stringutils.cpp | 13 | ||||
-rw-r--r-- | src/utils/stringutils.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index e28013320..8c6d88d1c 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -476,6 +476,19 @@ void splitToStringSet(std::set<std::string> &tokens, const std::string &text, } } +void splitToIntVector(std::vector<int> &tokens, const std::string &text, + const char separator) +{ + std::stringstream ss(text); + std::string item; + while (std::getline(ss, item, separator)) + { + item = trim(item); + if (!item.empty()) + tokens.push_back(atoi(item.c_str())); + } +} + std::string combineDye(std::string file, std::string dye) { if (dye.empty()) diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index 9355e1720..2b10b7631 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -191,6 +191,9 @@ void splitToStringVector(StringVect &tokens, void splitToStringSet(std::set<std::string> &tokens, const std::string &text, const char separator); +void splitToIntVector(std::vector<int> &tokens, + const std::string &text, const char separator); + std::string combineDye(std::string file, std::string dye); std::string combineDye2(std::string file, std::string dye); |