summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp13
1 files changed, 13 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())