MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / extractJsonString

Function extractJsonString

engine/Evaluator/Validate.cpp:344–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344static 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
360ValidationSummary validateRef(const std::string& refDir, GameState& gs, bool verbose)
361{

Callers 1

validateRefFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected