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

Method SetJson

src/Profiles.cpp:295–309  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected