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