MCPcopy Create free account
hub / github.com/crownengine/crown / parse_verbatim

Function parse_verbatim

src/core/json/sjson.cpp:690–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688 }
689
690 void parse_verbatim(DynamicString &str, const char *json)
691 {
692 if (json == NULL) {
693 fatal("json is NULL");
694 return;
695 }
696
697 NEXT_OR_RETURN(json, '"', /*void*/);
698 NEXT_OR_RETURN(json, '"', /*void*/);
699 NEXT_OR_RETURN(json, '"', /*void*/);
700
701 const char *end = strstr(json, "\"\"\"");
702 if (end == NULL) {
703 fatal("Bad verbatim string");
704 return;
705 }
706
707 // Find last '"'.
708 end += 3;
709 while (*end && *end == '"')
710 ++end;
711
712 str.set(json, u32(end - 3 - json));
713 }
714
715} // namespace json
716

Callers 5

test_sjsonFunction · 0.85
parse_bgfx_shadersMethod · 0.85
console_command_scriptFunction · 0.85
console_command_REPLFunction · 0.85
console_command_suggestFunction · 0.85

Calls 3

strstrFunction · 0.85
fatalFunction · 0.70
setMethod · 0.45

Tested by 1

test_sjsonFunction · 0.68