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:
@@ -6,7 +6,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
QList<CFrequency> CSelcal::frequencyEquivalents = QList<CFrequency>();
|
||||
QStringList CSelcal::allCodePairs = QStringList();
|
||||
|
||||
@@ -205,5 +204,28 @@ namespace BlackMisc
|
||||
qDBusRegisterMetaType<CSelcal>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
const QStringList &CSelcal::jsonMembers()
|
||||
{
|
||||
return TupleConverter<CSelcal>::jsonMembers();
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
QJsonObject CSelcal::toJson() const
|
||||
{
|
||||
return BlackMisc::serializeJson(CSelcal::jsonMembers(), TupleConverter<CSelcal>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* From Json
|
||||
*/
|
||||
void CSelcal::fromJson(const QJsonObject &json)
|
||||
{
|
||||
BlackMisc::deserializeJson(json, CSelcal::jsonMembers(), TupleConverter<CSelcal>::toTuple(*this));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user