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

Method SetJson

src/CacheMemory.cpp:300–314  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

298
299// Load JSON string into this object
300void CacheMemory::SetJson(const std::string value) {
301
302 try
303 {
304 // Parse string to Json::Value
305 const Json::Value root = openshot::stringToJson(value);
306 // Set all values that match
307 SetJsonValue(root);
308 }
309 catch (const std::exception& e)
310 {
311 // Error parsing JSON (or missing keys)
312 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
313 }
314}
315
316// Load Json::Value into this object
317void CacheMemory::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected