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