Load JSON string into this object
| 186 | |
| 187 | // Load JSON string into this object |
| 188 | void WriterBase::SetJson(const std::string value) { |
| 189 | |
| 190 | // Parse JSON string into JSON objects |
| 191 | try |
| 192 | { |
| 193 | const Json::Value root = openshot::stringToJson(value); |
| 194 | // Set all values that match |
| 195 | SetJsonValue(root); |
| 196 | } |
| 197 | catch (const std::exception& e) |
| 198 | { |
| 199 | // Error parsing JSON (or missing keys) |
| 200 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | // Load Json::Value into this object |
| 205 | void WriterBase::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected