|
QGroundControl
Ground Control Station for MAVLink Drones
|
Functions | |
| bool | validateRequiredKeys (const QJsonObject &jsonObject, const QStringList &keys, QString &errorString) |
| Validates that all listed keys are present in the object. | |
| 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. | |
| bool | isJsonFile (const QString &fileName, QJsonDocument &jsonDoc, QString &errorString) |
| Determines whether a file path contains parseable JSON content. | |
| double | possibleNaNJsonValue (const QJsonValue &value) |
| Returns NaN if the value is null, or the value converted to double otherwise. | |
| bool JsonParsing::isJsonFile | ( | const QByteArray & | bytes, |
| QJsonDocument & | jsonDoc, | ||
| QString & | errorString | ||
| ) |
Determines whether an in-memory byte buffer contains parseable JSON content.
Definition at line 93 of file JsonParsing.cc.
References errorString, and QGCNetworkHelper::parseCompressedJson().
Referenced by GeoJsonHelper::_loadFile(), isJsonFile(), PlanMasterController::loadFromFile(), CompInfoGeneral::setJson(), CompInfoParam::setJson(), and ComponentInformationTranslation::translateJsonUsingTS().
| bool JsonParsing::isJsonFile | ( | const QString & | fileName, |
| QJsonDocument & | jsonDoc, | ||
| QString & | errorString | ||
| ) |
Determines whether a file path contains parseable JSON content.
Definition at line 110 of file JsonParsing.cc.
References errorString, isJsonFile(), and QGCFileHelper::readFile().
| double JsonParsing::possibleNaNJsonValue | ( | const QJsonValue & | value | ) |
Returns NaN if the value is null, or the value converted to double otherwise.
Definition at line 120 of file JsonParsing.cc.
Referenced by MissionItem::load(), SimpleMissionItem::load(), JsonHelper::loadGeoCoordinate(), and MissionCommandUIInfo::loadJsonInfo().
| bool JsonParsing::validateKeyTypes | ( | const QJsonObject & | jsonObject, |
| const QStringList & | keys, | ||
| const QList< QJsonValue::Type > & | types, | ||
| QString & | errorString | ||
| ) |
Validates value types for listed keys that are present in the object. QJsonValue::Null as expected type means "double value with possible NaN".
Definition at line 64 of file JsonParsing.cc.
References errorString.
Referenced by MissionCommandUIInfo::loadJsonInfo().
| bool JsonParsing::validateRequiredKeys | ( | const QJsonObject & | jsonObject, |
| const QStringList & | keys, | ||
| QString & | errorString | ||
| ) |
Validates that all listed keys are present in the object.
Definition at line 43 of file JsonParsing.cc.
References errorString.
Referenced by QGCMapPolygon::loadFromJson(), QGCMapPolyline::loadFromJson(), and MissionCommandUIInfo::loadJsonInfo().