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

Method SetJson

src/effects/ChromaKey.cpp:657–671  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

655
656// Load JSON string into this object
657void ChromaKey::SetJson(const std::string value) {
658
659 // Parse JSON string into JSON objects
660 try
661 {
662 const Json::Value root = openshot::stringToJson(value);
663 // Set all values that match
664 SetJsonValue(root);
665 }
666 catch (const std::exception& e)
667 {
668 // Error parsing JSON (or missing keys)
669 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
670 }
671}
672
673// Load Json::Value into this object
674void ChromaKey::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected