NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
configurationmanager.h
Go to the documentation of this file.
1#ifndef CONFIGURATIONMANAGER_H
2#define CONFIGURATIONMANAGER_H
3
4#include <QSettings>
5#include <QStringList>
6#include <QMutex>
7#include <QMutexLocker>
8
10public:
11 explicit ConfigurationManager(const QString& iniFilePath);
12
13 QString getConfigValue(const QString& section, const QString& key, const QString& defaultValue = QString()) const;
14 QStringList getConfigKeys(const QString &section);
15 QStringList getConfigSections() const;
16 void setConfigValue(const QString& section, const QString& key, const QString& value);
17
18private:
19 QSettings m_settings;
20 mutable QMutex m_mutex; // used for thread safety
21
22 QStringList getKeysInSection(const QString &section); // helper function to reduce code duplication
23};
24
25#endif // CONFIGURATIONMANAGER_H
Definition configurationmanager.h:9
QStringList getConfigKeys(const QString &section)
Definition configurationmanager.cpp:20
void setConfigValue(const QString &section, const QString &key, const QString &value)
Definition configurationmanager.cpp:44
QString getConfigValue(const QString &section, const QString &key, const QString &defaultValue=QString()) const
Definition configurationmanager.cpp:15
QStringList getConfigSections() const
Definition configurationmanager.cpp:39