25 #include "ini/settingsprovider.h"
26 #include "ini/settingsproviderqt.h"
42 d->provider = provider;
62 removeKey(sectionName);
67 removeKey(sectionName +
"/" + settingName);
70 bool Ini::hasSetting(
const QString& sectionname,
const QString& settingname)
const
72 return d->provider->hasKey(sectionname +
"/" + settingname);
75 void Ini::removeKey(
const QString& key)
77 d->provider->remove(key);
103 QVector<IniSection> sectionsReferencesArray;
105 QRegExp regExp(regexPattern, Qt::CaseInsensitive);
107 QStringList groups = d->provider->allSections();
109 foreach (
const QString& key, groups)
111 if (key.contains(regExp))
113 sectionsReferencesArray <<
IniSection(
this, key);
117 return sectionsReferencesArray;
122 if (sectionName.isEmpty() || variableName.isEmpty())
136 void Ini::setValue(
const QString& key,
const QVariant& value)
138 assert(d->provider != NULL);
140 d->provider->setValue(key, value);
143 QVariant Ini::value(
const QString& key)
const
145 assert(d->provider != NULL);
147 return d->provider->value(key);
IniVariable createSetting(const QString &name, const QVariant &data)
Inits specified variable with specified data.
IniVariable createSetting(const QString §ionname, const QString &name, const QVariant &data)
INI variable representation.
bool hasSetting(const QString §ionname, const QString &settingname) const
true if setting of given name exists within given section.
QVector< IniSection > sectionsArray(const QString ®exPattern)
IniVariable setting(const QString §ionname, const QString &variablename)
IniVariable retrieveSetting(const QString &name)
Gets a variable but only if it already exists.
IniVariable retrieveSetting(const QString §ionname, const QString &variablename)
INI section representation.
bool isNull() const
If true, IniSection object is not valid and should not be used to perform any actions on the Ini file...
IniSection section(const QString &name)
Access configuration file section.
bool isNull() const
If true, IniSection object is not valid and should not be used to perform any actions on the Ini file...
void deleteSection(const QString §ionname)
void deleteSetting(const QString §ionname, const QString &settingname)