![]() |
ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
|
The ToolX configuration file: a JSON document holding every stream table and the overlay settings, written by File > Export and read by File > Import. More...
#include "config_file.h"#include <QFile>#include <QJsonDocument>#include <QJsonParseError>#include <QSaveFile>
Functions | |
| bool | toolx::config::writeFile (const QString &path, const QJsonObject §ions, const QString &toolx_version, QString &error) |
| Write a configuration file. | |
| bool | toolx::config::readFile (const QString &path, QJsonObject &document, QString &error) |
| Read and check a configuration file. | |
The ToolX configuration file: a JSON document holding every stream table and the overlay settings, written by File > Export and read by File > Import.
| bool toolx::config::readFile | ( | const QString & | path, |
| QJsonObject & | document, | ||
| QString & | error ) |
Read and check a configuration file.
| path | the file to read |
| document | set to the whole document, including the header, when true is returned |
| error | set to the reason when false is returned |
| bool toolx::config::writeFile | ( | const QString & | path, |
| const QJsonObject & | sections, | ||
| const QString & | toolx_version, | ||
| QString & | error ) |
Write a configuration file.
The header (application, file version and ToolX version) is added to the sections. The file is only readable by its owner because it can hold passphrases. It is written to a temporary file first, so a failure leaves any existing file untouched.
| path | the file to write |
| sections | the sections to store, keyed by the names in section |
| toolx_version | the version of ToolX writing the file |
| error | set to the reason when false is returned |