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