MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / parse_string

Method parse_string

core/io/json.cpp:608–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608Variant JSON::parse_string(const String &p_json_string) {
609 Ref<JSON> json;
610 json.instantiate();
611 Error error = json->parse(p_json_string);
612 ERR_FAIL_COND_V_MSG(error != Error::OK, Variant(), vformat("Parse JSON failed. Error at line %d: %s", json->get_error_line(), json->get_error_message()));
613 return json->get_data();
614}
615
616void JSON::_bind_methods() {
617 ClassDB::bind_static_method("JSON", D_METHOD("stringify", "data", "indent", "sort_keys", "full_precision"), &JSON::stringify, DEFVAL(""), DEFVAL(true), DEFVAL(false));

Callers

nothing calls this directly

Calls 7

vformatFunction · 0.85
get_error_messageMethod · 0.80
VariantClass · 0.50
instantiateMethod · 0.45
parseMethod · 0.45
get_error_lineMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected