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

Method SetJson

src/effects/Tracker.cpp:189–204  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

187
188// Load JSON string into this object
189void Tracker::SetJson(const std::string value) {
190
191 // Parse JSON string into JSON objects
192 try
193 {
194 const Json::Value root = openshot::stringToJson(value);
195 // Set all values that match
196 SetJsonValue(root);
197 }
198 catch (const std::exception& e)
199 {
200 // Error parsing JSON (or missing keys)
201 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
202 }
203 return;
204}
205
206// Load Json::Value into this object
207void Tracker::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected