25 #include "ini/settingsprovider.h" 26 #include "ini/settingsproviderqt.h" 28 #include "strings.hpp" 42 d->provider = provider;
60 for (
const QString &key : d->provider->allKeys())
62 if (key.startsWith(sectionName +
"/", Qt::CaseInsensitive))
69 removeKey(sectionName +
"/" + settingName);
72 bool Ini::hasSetting(
const QString §ionname,
const QString &settingname)
const 74 return d->provider->hasKey(sectionname +
"/" + settingname);
77 void Ini::removeKey(
const QString &key)
79 d->provider->remove(key);
101 QVector<IniSection> sectionsReferencesArray;
103 QRegExp regExp(regexPattern, Qt::CaseInsensitive);
105 QStringList groups = d->provider->allSections();
107 for (
const QString &key : groups)
109 if (key.contains(regExp))
110 sectionsReferencesArray <<
IniSection(
this, key);
113 return sectionsReferencesArray;
118 if (sectionName.isEmpty() || variableName.isEmpty())
128 void Ini::setValue(
const QString &key,
const QVariant &value)
130 assert(d->provider !=
nullptr);
132 d->provider->setValue(key, value);
135 QVariant Ini::value(
const QString &key)
const 137 assert(d->provider !=
nullptr);
139 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)