23 #include "inisection.h" 50 d->name = sectionName;
53 IniSection::~IniSection()
63 if (
value(name).isNull())
81 return d->pIni->hasSetting(this->
name(), name);
86 return d->pIni ==
nullptr;
104 void IniSection::remove(
const QString &key)
106 d->pIni->removeKey(
name() +
"/" + key);
145 d->pIni->setValue(
name() +
"/" + key, value);
151 return d->pIni->value(
name() +
"/" + key);
158 QVariant val =
value(key);
IniVariable createSetting(const QString &name, const QVariant &data)
Inits specified variable with specified data.
INI variable representation.
void deleteSetting(const QString &name)
Deletes specified variable.
const QString & name() const
A name (or path) of this section with lettercase preserved.
IniSection()
Creates an invalid IniSection object. Such object should not be used for read/write operations...
IniVariable operator[](const QString &name)
Calls setting().
QVariant value(const QString &key) const
Retrieves a variable directly; omits the IniVariable system.
bool hasSetting(const QString &name) const
true if setting of given name exists within the section.
IniVariable retrieveSetting(const QString &name)
Gets a variable but only if it already exists.
IniVariable setting(const QString &name)
Gets a variable. Creates it first if it doesn't exist yet.
void setValue(const QString &key, const QVariant &value)
Sets a variable directly. Omits the IniVariable system.
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...
bool isNull() const
If true, IniSection object is not valid and should not be used to perform any actions on the Ini file...