QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
JsonHelper.h File Reference
#include <QtCore/QLoggingCategory>
#include <QtCore/QJsonObject>
#include <QtCore/QVariantList>
#include <QtPositioning/QGeoCoordinate>
+ Include dependency graph for JsonHelper.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JsonHelper::KeyValidateInfo
 

Namespaces

namespace  JsonHelper
 

Functions

QTranslator * JsonHelper::translator ()
 
void JsonHelper::saveQGCJsonFileHeader (QJsonObject &jsonObject, const QString &fileType, int version)
 Saves the standard file header the json object.
 
bool JsonHelper::validateExternalQGCJsonFile (const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
 returned error string if validation fails
 
bool JsonHelper::validateInternalQGCJsonFile (const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
 returned error string if validation fails
 
QJsonObject JsonHelper::openInternalQGCJsonFile (const QString &jsonFilename, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
 returned error string if validation fails
 
bool JsonHelper::validateKeys (const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
 
bool JsonHelper::loadGeoCoordinate (const QJsonValue &jsonValue, bool altitudeRequired, QGeoCoordinate &coordinate, QString &errorString, bool geoJsonFormat=false)
 if true, use [lon, lat], [lat, lon] otherwise
 
void JsonHelper::saveGeoCoordinate (const QGeoCoordinate &coordinate, bool writeAltitude, QJsonValue &jsonValue, bool geoJsonFormat=false)
 
bool JsonHelper::loadGeoCoordinateArray (const QJsonValue &jsonValue, bool altitudeRequired, QVariantList &rgVarPoints, QString &errorString)
 returned error string if load failure
 
bool JsonHelper::loadGeoCoordinateArray (const QJsonValue &jsonValue, bool altitudeRequired, QList< QGeoCoordinate > &rgPoints, QString &errorString)
 returned error string if load failure
 
void JsonHelper::saveGeoCoordinateArray (const QVariantList &rgVarPoints, bool writeAltitude, QJsonValue &jsonValue)
 Saves a list of QGeoCoordinates to a json array.
 
void JsonHelper::saveGeoCoordinateArray (const QList< QGeoCoordinate > &rgPoints, bool writeAltitude, QJsonValue &jsonValue)
 json value to save to
 
bool JsonHelper::loadPolygon (const QJsonArray &polygonArray, QmlObjectListModel &list, QObject *parent, QString &errorString)
 Loads a polygon from an array.
 
void JsonHelper::savePolygon (const QmlObjectListModel &list, QJsonArray &polygonArray)
 Saves a polygon to a json array.
 

Variables

constexpr const char * JsonHelper::jsonVersionKey = "version"
 
constexpr const char * JsonHelper::jsonFileTypeKey = "fileType"