mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #561, Compressed JSON format for model
* based on RI DB keys * utility functions
This commit is contained in:
@@ -198,5 +198,21 @@ namespace BlackMisc
|
||||
}
|
||||
return msgs;
|
||||
}
|
||||
|
||||
QJsonArray CAircraftModelList::toDatabaseJson() const
|
||||
{
|
||||
QJsonArray array;
|
||||
for (const CAircraftModel &model : *this)
|
||||
{
|
||||
QJsonValue v(model.toDatabaseJson());
|
||||
array.append(v);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
QString CAircraftModelList::toDatabaseJsonString(QJsonDocument::JsonFormat format) const
|
||||
{
|
||||
return QJsonDocument(toDatabaseJson()).toJson(format);
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user