Load JSON string into this object
| 293 | |
| 294 | // Load JSON string into this object |
| 295 | void Profile::SetJson(const std::string value) { |
| 296 | |
| 297 | // Parse JSON string into JSON objects |
| 298 | try |
| 299 | { |
| 300 | const Json::Value root = openshot::stringToJson(value); |
| 301 | // Set all values that match |
| 302 | SetJsonValue(root); |
| 303 | } |
| 304 | catch (const std::exception& e) |
| 305 | { |
| 306 | // Error parsing JSON (or missing keys) |
| 307 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | // Load Json::Value into this object |
| 312 | void Profile::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected