| 184 | |
| 185 | |
| 186 | std::vector<std::string> splitString(const std::string& str, char sep) |
| 187 | { |
| 188 | std::vector<std::string> l; |
| 189 | |
| 190 | std::string::size_type pos1 = 0; |
| 191 | std::string::size_type pos2; |
| 192 | while (true) { |
| 193 | pos2 = str.find(sep, pos1); |
| 194 | l.push_back(str.substr(pos1, pos2 - pos1)); |
| 195 | if (pos2 == std::string::npos) |
| 196 | break; |
| 197 | pos1 = pos2 + 1; |
| 198 | } |
| 199 | return l; |
| 200 | } |