| 250 | } |
| 251 | |
| 252 | void string_split_each(const std::string& text, const char* delims, std::function<bool(size_t, size_t)> fn) |
| 253 | { |
| 254 | std::size_t start = text.find_first_not_of(delims), end = 0; |
| 255 | |
| 256 | while ((end = text.find_first_of(delims, start)) != std::string::npos) |
| 257 | { |
| 258 | if (!fn(start, end - start)) |
| 259 | return; |
| 260 | start = text.find_first_not_of(delims, end); |
| 261 | } |
| 262 | if (start != std::string::npos) |
| 263 | fn(start, text.length() - start); |
| 264 | } |
| 265 | |
| 266 | size_t string_first_not_of(const char* text, size_t start, size_t end, const char* delims) |
| 267 | { |
nothing calls this directly
no test coverage detected