QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
JsonParsing.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QJsonDocument>
4#include <QtCore/QJsonObject>
5#include <QtCore/QJsonValue>
6#include <QtCore/QStringList>
7
8namespace JsonParsing {
9
11bool isJsonFile(const QString& fileName, QJsonDocument& jsonDoc, QString& errorString);
12
14bool isJsonFile(const QByteArray& bytes, QJsonDocument& jsonDoc, QString& errorString);
15
17bool validateRequiredKeys(const QJsonObject& jsonObject, const QStringList& keys, QString& errorString);
18
21bool validateKeyTypes(const QJsonObject& jsonObject, const QStringList& keys, const QList<QJsonValue::Type>& types,
22 QString& errorString);
23
25double possibleNaNJsonValue(const QJsonValue& value);
26
27} // namespace JsonParsing
QString errorString
bool validateKeyTypes(const QJsonObject &jsonObject, const QStringList &keys, const QList< QJsonValue::Type > &types, QString &errorString)
bool isJsonFile(const QByteArray &bytes, QJsonDocument &jsonDoc, QString &errorString)
Determines whether an in-memory byte buffer contains parseable JSON content.
double possibleNaNJsonValue(const QJsonValue &value)
Returns NaN if the value is null, or the value converted to double otherwise.
bool validateRequiredKeys(const QJsonObject &jsonObject, const QStringList &keys, QString &errorString)
Validates that all listed keys are present in the object.