Load JSON string into this object
| 98 | |
| 99 | // Load JSON string into this object |
| 100 | void Color::SetJson(const std::string value) { |
| 101 | |
| 102 | // Parse JSON string into JSON objects |
| 103 | try |
| 104 | { |
| 105 | const Json::Value root = openshot::stringToJson(value); |
| 106 | // Set all values that match |
| 107 | SetJsonValue(root); |
| 108 | } |
| 109 | catch (const std::exception& e) |
| 110 | { |
| 111 | // Error parsing JSON (or missing keys) |
| 112 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // Load Json::Value into this object |
| 117 | void Color::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected