| openPilotLog

Public Member Functions | Static Public Member Functions | List of all members
AJson Class Reference

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

`#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. More...
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 More...
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

## ◆ exportDatabase()

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.

## ◆ readFileToDoc()

QJsonDocument AJson::readFileToDoc | ( | const QString & | file_path | ) |
| static

readToDocument reads data from a JSON file into a QJSonDocument

Parameters

  file_path |

The documentation for this class was generated from the following files:

- src/classes/ajson.h
- src/classes/ajson.cpp