Load JSON string into this object
| 208 | |
| 209 | // Load JSON string into this object |
| 210 | void TextReader::SetJson(const std::string value) { |
| 211 | try |
| 212 | { |
| 213 | Json::Value root = openshot::stringToJson(value); |
| 214 | // Set all values that match |
| 215 | SetJsonValue(root); |
| 216 | } |
| 217 | catch (const std::exception& e) |
| 218 | { |
| 219 | // Error parsing JSON (or missing keys) |
| 220 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // Load Json::Value into this object |
| 225 | void TextReader::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected