Load JSON string into this object
| 256 | |
| 257 | // Load JSON string into this object |
| 258 | void Saturation::SetJson(const std::string value) { |
| 259 | |
| 260 | // Parse JSON string into JSON objects |
| 261 | try |
| 262 | { |
| 263 | const Json::Value root = openshot::stringToJson(value); |
| 264 | // Set all values that match |
| 265 | SetJsonValue(root); |
| 266 | } |
| 267 | catch (const std::exception& e) |
| 268 | { |
| 269 | // Error parsing JSON (or missing keys) |
| 270 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | // Load Json::Value into this object |
| 275 | void Saturation::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected