QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
JsonParsing.cc File Reference
#include "JsonParsing.h"
#include <limits>
#include <QtCore/QApplicationStatic>
#include <QtCore/QFileInfo>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonParseError>
#include <QtCore/QObject>
#include <QtCore/QSet>
#include <QtCore/QTranslator>
#include "QGCCompression.h"
#include "QGCLoggingCategory.h"
+ Include dependency graph for JsonParsing.cc:

Go to the source code of this file.

Namespaces

namespace  JsonParsing
 

Functions

bool JsonParsing::validateRequiredKeys (const QJsonObject &jsonObject, const QStringList &keys, QString &errorString)
 Validates that all listed keys are present in the object.
 
bool JsonParsing::validateKeyTypes (const QJsonObject &jsonObject, const QStringList &keys, const QList< QJsonValue::Type > &types, QString &errorString)
 
bool JsonParsing::isJsonFile (const QByteArray &bytes, QJsonDocument &jsonDoc, QString &errorString)
 Determines whether an in-memory byte buffer contains parseable JSON content.
 
bool JsonParsing::isJsonFile (const QString &fileName, QJsonDocument &jsonDoc, QString &errorString)
 Determines whether a file path contains parseable JSON content.
 
double JsonParsing::possibleNaNJsonValue (const QJsonValue &value)
 Returns NaN if the value is null, or the value converted to double otherwise.
 
bool JsonParsing::validateKeys (const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
 Validates that all required keys are present and that listed keys have the expected type.
 
bool JsonParsing::validateKeysStrict (const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
 Validates keys like validateKeys but also rejects any keys not listed in keyInfo.
 
QTranslator * JsonParsing::translator ()
 Translator used by openInternalQGCJsonFile for localized strings.
 
void JsonParsing::saveQGCJsonFileHeader (QJsonObject &jsonObject, const QString &fileType, int version)
 Saves the standard QGC file header (groundStation, fileType, version) into the json object.
 
bool JsonParsing::validateInternalQGCJsonFile (const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
 
bool JsonParsing::validateExternalQGCJsonFile (const QJsonObject &jsonObject, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString)
 
QJsonObject JsonParsing::openInternalQGCJsonFile (const QString &jsonFilename, const QString &expectedFileType, int minSupportedVersion, int maxSupportedVersion, int &version, QString &errorString, const QStringList &defaultTranslateKeys, const QStringList &defaultArrayIDKeys)