| 432 | } |
| 433 | |
| 434 | std::string grab_token_string_pos(const std::string& source, int32_t pos, char compc) |
| 435 | { // Cleaned up from g_src/basics.cpp, return string instead of bool |
| 436 | std::string out; |
| 437 | |
| 438 | // Go until you hit compc, ']', or the end |
| 439 | for (auto s = source.begin() + pos; s < source.end(); ++s) |
| 440 | { |
| 441 | if (*s == compc || *s == ']') |
| 442 | break; |
| 443 | out += *s; |
| 444 | } |
| 445 | |
| 446 | return out; |
| 447 | } |
| 448 | |
| 449 | bool prefix_matches(const std::string &prefix, const std::string &key, std::string *tail) |
| 450 | { |