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

Method SetJson

src/EffectBase.cpp:122–136  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

120
121// Load JSON string into this object
122void EffectBase::SetJson(const std::string value) {
123
124 // Parse JSON string into JSON objects
125 try
126 {
127 Json::Value root = openshot::stringToJson(value);
128 // Set all values that match
129 SetJsonValue(root);
130 }
131 catch (const std::exception& e)
132 {
133 // Error parsing JSON (or missing keys)
134 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
135 }
136}
137
138// Load Json::Value into this object
139void EffectBase::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected