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

Method SetJson

src/effects/Mask.cpp:190–204  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

188
189// Load JSON string into this object
190void Mask::SetJson(const std::string value) {
191
192 // Parse JSON string into JSON objects
193 try
194 {
195 const Json::Value root = openshot::stringToJson(value);
196 // Set all values that match
197 SetJsonValue(root);
198 }
199 catch (const std::exception& e)
200 {
201 // Error parsing JSON (or missing keys)
202 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
203 }
204}
205
206// Load Json::Value into this object
207void Mask::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected