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