INI variable representation. More...
#include <inivariable.h>
Public Member Functions | |
| IniVariable () | |
| Creates an invalid IniVariable object. Such object should not be used for read/write operations. | |
| IniVariable (IniSection *pSection, const QString &key) | |
| Creates a valid IniVariable object. Read/write operations are permitted. | |
| IniVariable (const IniSection *pSection, const QString &key) | |
| Creates a valid IniVariable, read-only object. | |
| bool | isNull () const |
| If true, IniSection object is not valid and should not be used to perform any actions on the Ini file. | |
| QString | valueString () const |
| Returns the underlying value as a QString. | |
| const IniVariable & | operator= (const QString &str) |
| const IniVariable & | operator= (const char *str) |
| const IniVariable & | operator= (int i) |
| const IniVariable & | operator= (unsigned int i) |
| const IniVariable & | operator= (short i) |
| const IniVariable & | operator= (unsigned short i) |
| const IniVariable & | operator= (bool b) |
| Sets the value to bool. | |
| const IniVariable & | operator= (float f) |
| const IniVariable & | operator= (const IniVariable &other) |
| QString | operator* () const |
| Attempts to convert the value to QString. | |
| operator QString () const | |
| Attempts to convert the value to QString. | |
| operator float () const | |
| Attempts to convert the value to a float. | |
| operator int () const | |
| Attempts to convert the value to a integer. | |
| operator unsigned int () const | |
| operator short () const | |
| operator unsigned short () const | |
| operator bool () const | |
| Convert value to boolean, if possible. It's done by converting to numValue() first, then to bool. | |
| operator IniVariable & () | |
| operator const IniVariable & () const | |
| void | setValue (const QVariant &value) |
| Explicitly sets the value from QVariant. | |
| QVariant | value () const |
| Extracts the value as QVariant. | |
Friends | |
| class | TestReadINIVariable |
| class | TestReadINIList |
INI variable representation.
Structure containing variable's value and comments. The name of the variable is not contained in the structure itself to prevent redundancy.
| IniVariable::IniVariable | ( | const IniSection * | pSection, | |
| const QString & | key | |||
| ) |
Creates a valid IniVariable, read-only object.
Only read operations are permitted. Performing write operations on such object will fail.
| const IniVariable & IniVariable::operator= | ( | bool | b | ) |
Sets the value to bool.
The value is set by converting the bool to a integer, 0 for false and 1 for true.
| QString IniVariable::valueString | ( | ) | const [inline] |
Returns the underlying value as a QString.
Internally the value is always accessed as QVariant.