25 #include "ini/settingsprovider.h" 26 #include "ini/settingsproviderqt.h" 28 #include "strings.hpp" 42 d->provider = provider;
62 foreach (
const QString &key, d->provider->allKeys())
64 if (key.startsWith(sectionName +
"/", Qt::CaseInsensitive))
71 removeKey(sectionName +
"/" + settingName);
74 bool Ini::hasSetting(
const QString& sectionname,
const QString& settingname)
const 76 return d->provider->hasKey(sectionname +
"/" + settingname);
79 void Ini::removeKey(
const QString& key)
81 d->provider->remove(key);
107 QVector<IniSection> sectionsReferencesArray;
109 QRegExp regExp(regexPattern, Qt::CaseInsensitive);
111 QStringList groups = d->provider->allSections();
113 foreach (
const QString& key, groups)
115 if (key.contains(regExp))
117 sectionsReferencesArray <<
IniSection(
this, key);
121 return sectionsReferencesArray;
126 if (sectionName.isEmpty() || variableName.isEmpty())
140 void Ini::setValue(
const QString& key,
const QVariant& value)
142 assert(d->provider != NULL);
144 d->provider->setValue(key, value);
147 QVariant Ini::value(
const QString& key)
const 149 assert(d->provider != NULL);
151 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, IniVariable object is not valid and should not be used to perform any actions on the Ini fil...
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)