MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetJSON

Method GetJSON

Source/Scripting/scriptparams.cpp:463–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463SimpleJSONWrapper ScriptParam::GetJSON() {
464 if (type_ != JSON) {
465 DisplayError("Error", "Calling GetJSON() on parameter of invalid type.");
466 }
467
468 SimpleJSONWrapper JSONVal;
469
470 if (JSONVal.parseString(str_val_)) {
471 return JSONVal;
472 } else {
473 DisplayError("Error", "Cannot parse JSON value.");
474 return JSONVal;
475 }
476}
477
478void ScriptParam::WriteToXML(TiXmlElement *param) const {
479 switch (type_) {

Callers 2

GetJSONValMethod · 0.80
ASGetJSONMethod · 0.80

Calls 2

parseStringMethod · 0.80
DisplayErrorFunction · 0.50

Tested by

no test coverage detected