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

Method SetJson

src/effects/Crop.cpp:144–158  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

142
143// Load JSON string into this object
144void Crop::SetJson(const std::string value) {
145
146 // Parse JSON string into JSON objects
147 try
148 {
149 const Json::Value root = openshot::stringToJson(value);
150 // Set all values that match
151 SetJsonValue(root);
152 }
153 catch (const std::exception& e)
154 {
155 // Error parsing JSON (or missing keys)
156 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
157 }
158}
159
160// Load Json::Value into this object
161void Crop::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected