MCPcopy Create free account
hub / github.com/DFHack/dfhack / grab_token_string_pos

Function grab_token_string_pos

library/MiscUtils.cpp:434–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434std::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
449bool prefix_matches(const std::string &prefix, const std::string &key, std::string *tail)
450{

Callers 1

MTB_parseMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected