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

Method SetJson

src/TextReader.cpp:210–222  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected