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

Method SetJson

src/WriterBase.cpp:188–202  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected