MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJson

Method SetJson

src/FrameMapper.cpp:791–811  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

789
790// Load JSON string into this object
791void 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
814void FrameMapper::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected