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

Method SetJson

src/effects/Caption.cpp:407–421  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

405
406// Load JSON string into this object
407void Caption::SetJson(const std::string value) {
408
409 // Parse JSON string into JSON objects
410 try
411 {
412 const Json::Value root = openshot::stringToJson(value);
413 // Set all values that match
414 SetJsonValue(root);
415 }
416 catch (const std::exception& e)
417 {
418 // Error parsing JSON (or missing keys)
419 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
420 }
421}
422
423// Load Json::Value into this object
424void Caption::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected