MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJson

Method SetJson

src/TrackedObjectBBox.h:84–98  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

82
83 /// Load JSON string into this object
84 void SetJson(const std::string value)
85 {
86 // Parse JSON string into JSON objects
87 try
88 {
89 const Json::Value root = openshot::stringToJson(value);
90 // Set all values that match
91 SetJsonValue(root);
92 }
93 catch (const std::exception &e)
94 {
95 // Error parsing JSON (or missing keys)
96 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
97 }
98 }
99
100 /// Load Json::Value into this object
101 void SetJsonValue(const Json::Value root)

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected