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