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

Method SetJson

src/Coordinate.cpp:53–67  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

51
52// Load JSON string into this object
53void Coordinate::SetJson(const std::string value) {
54
55 // Parse JSON string into JSON objects
56 try
57 {
58 const Json::Value root = openshot::stringToJson(value);
59 // Set all values that match
60 SetJsonValue(root);
61 }
62 catch (const std::exception& e)
63 {
64 // Error parsing JSON (or missing keys)
65 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
66 }
67}
68
69// Load Json::Value into this object
70void Coordinate::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected