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

Method SetJson

src/QtImageReader.cpp:356–370  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

354
355// Load JSON string into this object
356void QtImageReader::SetJson(const std::string value) {
357
358 // Parse JSON string into JSON objects
359 try
360 {
361 const Json::Value root = openshot::stringToJson(value);
362 // Set all values that match
363 SetJsonValue(root);
364 }
365 catch (const std::exception& e)
366 {
367 // Error parsing JSON (or missing keys)
368 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
369 }
370}
371
372// Load Json::Value into this object
373void QtImageReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected