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

Method SetJson

src/effects/Bars.cpp:124–138  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

122
123// Load JSON string into this object
124void Bars::SetJson(const std::string value) {
125
126 // Parse JSON string into JSON objects
127 try
128 {
129 const Json::Value root = openshot::stringToJson(value);
130 // Set all values that match
131 SetJsonValue(root);
132 }
133 catch (const std::exception& e)
134 {
135 // Error parsing JSON (or missing keys)
136 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
137 }
138}
139
140// Load Json::Value into this object
141void Bars::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected