diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 11 |
1 files changed, 11 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; +} |