Load JSON string into this object
| 266 | |
| 267 | // Load JSON string into this object |
| 268 | void ChunkReader::SetJson(const std::string value) { |
| 269 | |
| 270 | try |
| 271 | { |
| 272 | const Json::Value root = openshot::stringToJson(value); |
| 273 | // Set all values that match |
| 274 | SetJsonValue(root); |
| 275 | } |
| 276 | catch (const std::exception& e) |
| 277 | { |
| 278 | // Error parsing JSON (or missing keys) |
| 279 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // Load Json::Value into this object |
| 284 | void ChunkReader::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected