Load JSON string into this object
| 142 | |
| 143 | // Load JSON string into this object |
| 144 | void Crop::SetJson(const std::string value) { |
| 145 | |
| 146 | // Parse JSON string into JSON objects |
| 147 | try |
| 148 | { |
| 149 | const Json::Value root = openshot::stringToJson(value); |
| 150 | // Set all values that match |
| 151 | SetJsonValue(root); |
| 152 | } |
| 153 | catch (const std::exception& e) |
| 154 | { |
| 155 | // Error parsing JSON (or missing keys) |
| 156 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | // Load Json::Value into this object |
| 161 | void Crop::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected