Load JSON string into this object
| 51 | |
| 52 | // Load JSON string into this object |
| 53 | void Coordinate::SetJson(const std::string value) { |
| 54 | |
| 55 | // Parse JSON string into JSON objects |
| 56 | try |
| 57 | { |
| 58 | const Json::Value root = openshot::stringToJson(value); |
| 59 | // Set all values that match |
| 60 | SetJsonValue(root); |
| 61 | } |
| 62 | catch (const std::exception& e) |
| 63 | { |
| 64 | // Error parsing JSON (or missing keys) |
| 65 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Load Json::Value into this object |
| 70 | void Coordinate::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected