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

Method SetJson

src/ChunkReader.cpp:268–281  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

266
267// Load JSON string into this object
268void ChunkReader::SetJson(const std::string value) {
269
270 try
271 {
272 const Json::Value root = openshot::stringToJson(value);
273 // Set all values that match
274 SetJsonValue(root);
275 }
276 catch (const std::exception& e)
277 {
278 // Error parsing JSON (or missing keys)
279 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
280 }
281}
282
283// Load Json::Value into this object
284void ChunkReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected