3#include <QtCore/QLoggingCategory>
4#include <QtCore/QJsonObject>
5#include <QtCore/QVariantList>
6#include <QtPositioning/QGeoCoordinate>
21 const QString &fileType,
30 const QString &expectedFileType,
31 int minSupportedVersion,
32 int maxSupportedVersion,
41 const QString &expectedFileType,
42 int minSupportedVersion,
43 int maxSupportedVersion,
50 const QString &expectedFileType,
51 int minSupportedVersion,
52 int maxSupportedVersion,
68 bool altitudeRequired,
69 QGeoCoordinate &coordinate,
71 bool geoJsonFormat =
false);
77 QJsonValue &jsonValue,
78 bool geoJsonFormat =
false);
83 bool altitudeRequired,
84 QVariantList &rgVarPoints,
87 bool altitudeRequired,
88 QList<QGeoCoordinate> &rgPoints,
94 QJsonValue &jsonValue);
97 QJsonValue &jsonValue);
107 QJsonArray &polygonArray);
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
bool validateExternalQGCJsonFile(const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
returned error string if validation fails
void saveGeoCoordinateArray(const QVariantList &rgVarPoints, bool writeAltitude, QJsonValue &jsonValue)
Saves a list of QGeoCoordinates to a json array.
bool loadGeoCoordinateArray(const QJsonValue &jsonValue, bool altitudeRequired, QVariantList &rgVarPoints, QString &errorString)
returned error string if load failure
QJsonObject openInternalQGCJsonFile(const QString &jsonFilename, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
returned error string if validation fails
constexpr const char * jsonVersionKey
QTranslator * translator()
bool loadPolygon(const QJsonArray &polygonArray, QmlObjectListModel &list, QObject *parent, QString &errorString)
Loads a polygon from an array.
bool validateKeys(const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
void saveQGCJsonFileHeader(QJsonObject &jsonObject, const QString &fileType, int version)
Saves the standard file header the json object.
constexpr const char * jsonFileTypeKey
void savePolygon(const QmlObjectListModel &list, QJsonArray &polygonArray)
Saves a polygon to a json array.
bool validateInternalQGCJsonFile(const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
returned error string if validation fails
void saveGeoCoordinate(const QGeoCoordinate &coordinate, bool writeAltitude, QJsonValue &jsonValue, bool geoJsonFormat=false)
bool loadGeoCoordinate(const QJsonValue &jsonValue, bool altitudeRequired, QGeoCoordinate &coordinate, QString &errorString, bool geoJsonFormat=false)
if true, use [lon, lat], [lat, lon] otherwise
bool required
true: key must be present
const char * key
json key name
QJsonValue::Type type
required type for key, QJsonValue::Null specifies double with possible NaN