31 #include "../include/Coordinate.h" 37 Coordinate::Coordinate() :
76 Json::CharReaderBuilder rbuilder;
77 Json::CharReader* reader(rbuilder.newCharReader());
80 bool success = reader->parse( value.c_str(),
81 value.c_str() + value.size(), &root, &errors );
86 throw InvalidJSON(
"JSON could not be parsed (or is invalid)");
93 catch (
const std::exception& e)
96 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)");
104 if (!root[
"X"].isNull())
105 X = root[
"X"].asDouble();
106 if (!root[
"Y"].isNull())
107 Y = root[
"Y"].asDouble();
void SetJsonValue(Json::Value root)
Load Json::JsonValue into this object.
void SetJson(std::string value)
Load JSON string into this object.
double Y
The Y value of the coordinate (usually representing the value of the property being animated) ...
double X
The X value of the coordinate (usually representing the frame #)
This namespace is the default namespace for all code in the openshot library.
Coordinate()
The default constructor, which defaults to (0,0)
Exception for invalid JSON.
std::string Json()
Get and Set JSON methods.
Json::Value JsonValue()
Generate Json::JsonValue for this object.