19static std::string_view
NextWord(std::string_view& line)
21 const size_t start = line.find_first_not_of(
Blank);
22 if (start == std::string_view::npos)
27 line.remove_prefix(start);
29 const bool quoted = line.front() ==
'"';
30 const size_t end = quoted ? line.find(
'"', 1) : line.find_first_of(
Blank);
31 const std::string_view word = quoted ? line.substr(1, end - 1) : line.substr(0, end);
32 line.remove_prefix(end == std::string_view::npos ? line.size() : end + (quoted ? 1 : 0));
38 std::vector<std::string> paths;
39 bool inSearchPaths =
false;
42 while (!gameinfo.empty())
44 const size_t lineEnd = gameinfo.find(
'\n');
45 std::string_view line = gameinfo.substr(0, lineEnd);
46 gameinfo.remove_prefix(lineEnd == std::string_view::npos ? gameinfo.size() : lineEnd + 1);
47 line = line.substr(0, line.find(
"//"));
49 const std::string_view key =
NextWord(line);
56 inSearchPaths =
SameKey(key,
"SearchPaths");
71 else if (depth == 1 &&
SameKey(key,
"Game"))