Load JSON string into this object
| 789 | |
| 790 | // Load JSON string into this object |
| 791 | void FrameMapper::SetJson(const std::string value) { |
| 792 | |
| 793 | // Parse JSON string into JSON objects |
| 794 | try |
| 795 | { |
| 796 | const Json::Value root = openshot::stringToJson(value); |
| 797 | // Set all values that match |
| 798 | SetJsonValue(root); |
| 799 | |
| 800 | if (!root["reader"].isNull()) // does Json contain a reader? |
| 801 | { |
| 802 | // Placeholder to load reader |
| 803 | // TODO: need a createReader method for this and Clip JSON methods |
| 804 | } |
| 805 | } |
| 806 | catch (const std::exception& e) |
| 807 | { |
| 808 | // Error parsing JSON (or missing keys) |
| 809 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | // Load Json::Value into this object |
| 814 | void FrameMapper::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected