7 std::vector<std::string>
stringSplitter(
const std::string &inString,
const std::string &separator,
bool useEmptyToken)
10 std::size_t prevPos = 0;
12 std::vector<std::string>
ret;
15 ret.push_back(inString);
19 while((pos = inString.find(separator, pos)) != std::string::npos)
21 if(!(pos == prevPos && !useEmptyToken))
23 ret.push_back(inString.substr(prevPos, (pos - prevPos)));
25 pos += separator.length();
28 if(!(inString.length() == prevPos && !useEmptyToken))
30 ret.push_back(inString.substr(prevPos, inString.length() - prevPos));