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

Method SetJson

src/effects/ColorShift.cpp:204–218  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

202
203// Load JSON string into this object
204void ColorShift::SetJson(const std::string value) {
205
206 // Parse JSON string into JSON objects
207 try
208 {
209 const Json::Value root = openshot::stringToJson(value);
210 // Set all values that match
211 SetJsonValue(root);
212 }
213 catch (const std::exception& e)
214 {
215 // Error parsing JSON (or missing keys)
216 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
217 }
218}
219
220// Load Json::Value into this object
221void ColorShift::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected