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

Method SetJson

src/DummyReader.cpp:167–181  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

165
166// Load JSON string into this object
167void DummyReader::SetJson(const std::string value) {
168
169 // Parse JSON string into JSON objects
170 try
171 {
172 const Json::Value root = openshot::stringToJson(value);
173 // Set all values that match
174 SetJsonValue(root);
175 }
176 catch (const std::exception& e)
177 {
178 // Error parsing JSON (or missing keys)
179 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
180 }
181}
182
183// Load Json::Value into this object
184void DummyReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected