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