| 329 | } |
| 330 | |
| 331 | std::string string_slurp_if(std::string::const_iterator& itr, std::string::const_iterator itrEnd, char first, char last) |
| 332 | { |
| 333 | if (itr == itrEnd) |
| 334 | { |
| 335 | return ""; |
| 336 | } |
| 337 | |
| 338 | auto itrCurrent = itr; |
| 339 | if (*itrCurrent == first) |
| 340 | { |
| 341 | while ((itrCurrent != itrEnd) && *itrCurrent != last) |
| 342 | { |
| 343 | itrCurrent++; |
| 344 | } |
| 345 | |
| 346 | if ((itrCurrent != itrEnd) && *itrCurrent == last) |
| 347 | { |
| 348 | itrCurrent++; |
| 349 | auto ret = std::string(itr, itrCurrent); |
| 350 | itr = itrCurrent; |
| 351 | return ret; |
| 352 | } |
| 353 | } |
| 354 | return ""; |
| 355 | } |
| 356 | |
| 357 | std::string string_slurp_if(std::string::const_iterator& itr, std::string::const_iterator itrEnd, std::function<bool(char)> fnIs) |
| 358 | { |