| 1235 | } |
| 1236 | |
| 1237 | inline std::vector<std::string> tokenSplit(const std::string& input) { |
| 1238 | std::vector<std::string> result; |
| 1239 | size_t curr = 0; |
| 1240 | size_t found = 0; |
| 1241 | while ((found = input.find_first_of(' ', curr)) != std::string::npos) { |
| 1242 | std::string token = input.substr(curr, found - curr); |
| 1243 | token = trimSpaces(token); |
| 1244 | if (token.size() > 0) { |
| 1245 | result.push_back(token); |
| 1246 | } |
| 1247 | curr = found + 1; |
| 1248 | } |
| 1249 | std::string token = input.substr(curr); |
| 1250 | token = trimSpaces(token); |
| 1251 | if (token.size() > 0) { |
| 1252 | result.push_back(token); |
| 1253 | } |
| 1254 | |
| 1255 | return result; |
| 1256 | } |
| 1257 | |
| 1258 | inline bool startsWith(const std::string& input, const std::string& query) { |
| 1259 | return input.compare(0, query.length(), query) == 0; |
no test coverage detected