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

Method SetJson

src/QtTextReader.cpp:221–235  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

219
220// Load JSON string into this object
221void QtTextReader::SetJson(const std::string value) {
222
223 // Parse JSON string into JSON objects
224 try
225 {
226 const Json::Value root = openshot::stringToJson(value);
227 // Set all values that match
228 SetJsonValue(root);
229 }
230 catch (const std::exception& e)
231 {
232 // Error parsing JSON (or missing keys)
233 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
234 }
235}
236
237// Load Json::Value into this object
238void QtTextReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected