21 #include "src/database/database.h"
22 #include <QJsonDocument>
24 #include <QJsonObject>
33 AJson(QFileInfo database_file);
58 static void writeDocToFile(
const QJsonDocument &doc,
const QString& file_name);
65 const static inline QList<OPL::DbTable> TABLES = {
68 OPL::DbTable::Currencies,
69 OPL::DbTable::Flights,
The AJSON class is responsible for parsing the database (sqlite) to and from JSON.
Definition: ajson.h:30
static QJsonDocument readFileToDoc(const QString &file_path)
readToDocument reads data from a JSON file into a QJSonDocument
Definition: ajson.cpp:56
static void writeDocToFile(const QJsonDocument &doc, const QString &file_name)
writes a QJsonDocument to a file
Definition: ajson.cpp:67
static void exportDatabase()
exportDatabase exports the currently active database to JSON.
Definition: ajson.cpp:23
static void importDatabase()
importDatabase imports a dataset from JSON. Files need to be at AStanardPaths::JSON for now.
Definition: ajson.cpp:37