| 342 | } |
| 343 | |
| 344 | static std::string extractJsonString(const std::string& json, const std::string& key) |
| 345 | { |
| 346 | std::string needle = "\"" + key + "\""; |
| 347 | size_t pos = json.find(needle); |
| 348 | if (pos == std::string::npos) |
| 349 | return ""; |
| 350 | pos = json.find('"', pos + needle.size()); |
| 351 | if (pos == std::string::npos) |
| 352 | return ""; |
| 353 | pos++; |
| 354 | size_t end = json.find('"', pos); |
| 355 | if (end == std::string::npos) |
| 356 | return ""; |
| 357 | return json.substr(pos, end - pos); |
| 358 | } |
| 359 | |
| 360 | ValidationSummary validateRef(const std::string& refDir, GameState& gs, bool verbose) |
| 361 | { |