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

Method SetJson

src/QtHtmlReader.cpp:202–216  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

200
201// Load JSON string into this object
202void QtHtmlReader::SetJson(const std::string value) {
203
204 // Parse JSON string into JSON objects
205 try
206 {
207 const Json::Value root = openshot::stringToJson(value);
208 // Set all values that match
209 SetJsonValue(root);
210 }
211 catch (const std::exception& e)
212 {
213 // Error parsing JSON (or missing keys)
214 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
215 }
216}
217
218// Load Json::Value into this object
219void QtHtmlReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected