You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
860 B
C++
46 lines
860 B
C++
11 years ago
|
#ifndef INISETTINGS_HPP
|
||
|
#define INISETTINGS_HPP
|
||
|
|
||
|
#include <QHash>
|
||
|
#include <QVariant>
|
||
|
|
||
|
class QTextStream;
|
||
|
|
||
|
namespace Wizard
|
||
|
{
|
||
|
|
||
|
typedef QHash<QString, QVariant> SettingsMap;
|
||
|
|
||
|
class IniSettings
|
||
|
{
|
||
|
public:
|
||
|
explicit IniSettings();
|
||
|
~IniSettings();
|
||
|
|
||
|
inline QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const
|
||
|
{
|
||
|
return mSettings.value(key, defaultValue);
|
||
|
}
|
||
|
|
||
|
inline void setValue(const QString &key, const QVariant &value)
|
||
|
{
|
||
|
mSettings.insert(key, value);
|
||
|
}
|
||
|
|
||
|
inline void remove(const QString &key)
|
||
|
{
|
||
|
mSettings.remove(key);
|
||
|
}
|
||
|
|
||
|
bool readFile(QTextStream &stream);
|
||
|
bool writeFile(QTextStream &stream);
|
||
|
|
||
|
private:
|
||
|
|
||
|
SettingsMap mSettings;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif // INISETTINGS_HPP
|