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

Method SetJson

src/ImageReader.cpp:134–148  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

132
133// Load JSON string into this object
134void ImageReader::SetJson(const std::string value) {
135
136 // Parse JSON string into JSON objects
137 try
138 {
139 const Json::Value root = openshot::stringToJson(value);
140 // Set all values that match
141 SetJsonValue(root);
142 }
143 catch (const std::exception& e)
144 {
145 throw InvalidJSON(
146 "JSON is invalid (missing keys or invalid data types)");
147 }
148}
149
150// Load Json::Value into this object
151void ImageReader::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected