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

Method SetJson

src/CacheDisk.cpp:451–465  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

449
450// Load JSON string into this object
451void CacheDisk::SetJson(const std::string value) {
452
453 // Parse JSON string into JSON objects
454 try
455 {
456 const Json::Value root = openshot::stringToJson(value);
457 // Set all values that match
458 SetJsonValue(root);
459 }
460 catch (const std::exception& e)
461 {
462 // Error parsing JSON (or missing keys)
463 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
464 }
465}
466
467// Load Json::Value into this object
468void CacheDisk::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected