refs #192, enable value objects for JSON:

* from/toJson methods
* jsonMembers where applicable
This commit is contained in:
Klaus Basan
2014-03-26 18:44:17 +01:00
parent 586e1e4053
commit 88fb9e8832
47 changed files with 910 additions and 276 deletions

View File

@@ -103,6 +103,30 @@ namespace BlackMisc
return qHash(TupleConverter<CCoordinateGeodetic>::toTuple(*this));
}
/*
* To JSON
*/
QJsonObject CCoordinateGeodetic::toJson() const
{
return BlackMisc::serializeJson(CCoordinateGeodetic::jsonMembers(), TupleConverter<CCoordinateGeodetic>::toTuple(*this));
}
/*
* To JSON
*/
void CCoordinateGeodetic::fromJson(const QJsonObject &json)
{
BlackMisc::deserializeJson(json, CCoordinateGeodetic::jsonMembers(), TupleConverter<CCoordinateGeodetic>::toTuple(*this));
}
/*
* Members
*/
const QStringList &CCoordinateGeodetic::jsonMembers()
{
return TupleConverter<CCoordinateGeodetic>::jsonMembers();
}
/*
* From WGS84 coordinates
*/