ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
config_file.h File Reference

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 <QJsonObject>
#include <QString>
Include dependency graph for config_file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  toolx::config::section
 The members (sections) of a configuration file, besides the header.

Functions

bool toolx::config::writeFile (const QString &path, const QJsonObject &sections, 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.

Variables

constexpr const char * toolx::config::kApplication = "ToolX"
 The value of the "application" member that marks a ToolX configuration file.
constexpr int toolx::config::kFileVersion = 1
constexpr qint64 toolx::config::kMaxFileSize = 4 * 1024 * 1024
 The largest configuration file that is read, in bytes.
constexpr const char * toolx::config::section::kOverlays = "overlays"
 Time and stream name overlays: { "time": bool, "streamName": bool }.
constexpr const char * toolx::config::section::kRtp = "rtp"
 RTP > RTP table: { "sapAnnouncements": bool, "streams": [ ... ] }.
constexpr const char * toolx::config::section::kGige = "gige"
 GigE > Device tab: the emulated device.
constexpr const char * toolx::config::section::kSrtTransmit = "srtTransmit"
 SRT > Transmit table: [ ... ].
constexpr const char * toolx::config::section::kSrtReceive = "srtReceive"
 SRT > Receive table: [ ... ].
constexpr const char * toolx::config::section::kRtsp = "rtsp"
 RTSP table: [ ... ].
constexpr const char * toolx::config::section::kHls = "hls"
 HLS table: [ ... ].
constexpr const char * toolx::config::section::kChromecast = "chromecast"
 Chromecast tab: the picture and test card settings.

Detailed Description

The ToolX configuration file: a JSON document holding every stream table and the overlay settings, written by File > Export and read by File > Import.

Function Documentation

◆ readFile()

bool toolx::config::readFile ( const QString & path,
QJsonObject & document,
QString & error )

Read and check a configuration file.

Parameters
paththe file to read
documentset to the whole document, including the header, when true is returned
errorset to the reason when false is returned
Returns
true if the file is a ToolX configuration file of a version this release can read

◆ writeFile()

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.

Parameters
paththe file to write
sectionsthe sections to store, keyed by the names in section
toolx_versionthe version of ToolX writing the file
errorset to the reason when false is returned
Returns
true if the file was written

Variable Documentation

◆ kFileVersion

int toolx::config::kFileVersion = 1
constexpr

The version of the file format written by this release. Files with a higher version are refused, as they were written by a newer ToolX