AJson(3)

NAME
AJson - The AJSON class is responsible for parsing the database (sqlite) to and from JSON.

SYNOPSIS

#include <ajson.h>

  Public Member Functions
AJson (QFileInfo database_file)

  Static Public Member Functions
static void exportDatabase ()
exportDatabase exports the currently active database to JSON.
static void importDatabase ()
importDatabase imports a dataset from JSON. Files need to be at AStanardPaths::JSON for now.
static QJsonDocument readFileToDoc (const QString &file_path)
readToDocument reads data from a JSON file into a QJSonDocument
static void writeDocToFile (const QJsonDocument &doc, const QString &file_name)
writes a QJsonDocument to a file

Detailed Description

The AJSON class is responsible for parsing the database (sqlite) to and from JSON.

Member Function Documentation

  void AJson::exportDatabase () [static]

exportDatabase exports the currently active database to JSON. QJsonObject can be constructed from QHash<QString, QVariant> aka QVariantmap. All rows are put into a QJsonArray and the Array is embedded into a QJsonDocument, which can be exported. The files are created at AStandardPaths::JSON.

  QJsonDocument AJson::readFileToDoc (const QString & file_path) [static]

readToDocument reads data from a JSON file into a QJSonDocument

Parameters
    file_path

Author

Generated automatically by Doxygen for openPilotLog from the source code.