mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #192, enable value objects for JSON:
* from/toJson methods * jsonMembers where applicable
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user