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

Method SetJson

src/CVTracker.cpp:391–405  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

389
390// Load JSON string into this object
391void CVTracker::SetJson(const std::string value) {
392 // Parse JSON string into JSON objects
393 try
394 {
395 const Json::Value root = openshot::stringToJson(value);
396 // Set all values that match
397
398 SetJsonValue(root);
399 }
400 catch (const std::exception& e)
401 {
402 // Error parsing JSON (or missing keys)
403 throw openshot::InvalidJSON("JSON is invalid (missing keys or invalid data types)");
404 }
405}
406
407// Load Json::Value into this object
408void CVTracker::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected