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

Method SetJson

src/effects/ObjectDetection.cpp:342–356  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

340
341// Load JSON string into this object
342void ObjectDetection::SetJson(const std::string value) {
343
344 // Parse JSON string into JSON objects
345 try
346 {
347 const Json::Value root = openshot::stringToJson(value);
348 // Set all values that match
349 SetJsonValue(root);
350 }
351 catch (const std::exception& e)
352 {
353 // Error parsing JSON (or missing keys)
354 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
355 }
356}
357
358// Load Json::Value into this object
359void ObjectDetection::SetJsonValue(const Json::Value root)

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected