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

Method SetJson

src/Point.cpp:87–101  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected