From 7ed530350226d268c3ccb80952f4176589e9a32a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 27 Oct 2012 03:35:10 +0300 Subject: Autoselect resolution under android. --- src/utils/stringutils.cpp | 13 +++++++++++++ src/utils/stringutils.h | 3 +++ 2 files changed, 16 insertions(+) (limited to 'src/utils') 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 &tokens, const std::string &text, } } +void splitToIntVector(std::vector &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 &tokens, const std::string &text, const char separator); +void splitToIntVector(std::vector &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); -- cgit v1.2.3-70-g09d2