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

Method SetJson

src/CVObjectDetection.cpp:359–374  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

357
358// Load JSON string into this object
359void CVObjectDetection::SetJson(const std::string value) {
360 // Parse JSON string into JSON objects
361 try
362 {
363 const Json::Value root = openshot::stringToJson(value);
364 // Set all values that match
365
366 SetJsonValue(root);
367 }
368 catch (const std::exception& e)
369 {
370 // Error parsing JSON (or missing keys)
371 // throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
372 std::cout<<"JSON is invalid (missing keys or invalid data types)"<<std::endl;
373 }
374}
375
376// Load Json::Value into this object
377void CVObjectDetection::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected