IniVariable Class Reference

INI variable representation. More...

#include <inivariable.h>

List of all members.

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 IniVariableoperator= (const QString &str)
const IniVariableoperator= (const char *str)
const IniVariableoperator= (int i)
const IniVariableoperator= (unsigned int i)
const IniVariableoperator= (short i)
const IniVariableoperator= (unsigned short i)
const IniVariableoperator= (bool b)
 Sets the value to bool.
const IniVariableoperator= (float f)
const IniVariableoperator= (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

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


The documentation for this class was generated from the following files: