Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

Blokkal::ConfigBase Class Reference

Encapsulates a XML configuration element. More...

#include <blokkalconfigbase.h>

Inheritance diagram for Blokkal::ConfigBase:

Blokkal::AccountConfig Blokkal::BlogConfig Blokkal::Entry

List of all members.


Public Member Functions

bool readBoolEntry (const QString &name, bool defaultValue=FALSE) const
QString readComplex (const QString &name, const QString &defaultValue=QString::null)
QString readEntry (const QString &name, const QString &defaultValue=QString::null) const
int readIntEntry (const QString &name, int defaultValue=0) const
unsigned int readUIntEntry (const QString &name, unsigned int defaultValue=0) const
unsigned long readULongEntry (const QString &name, unsigned long defaultValue=FALSE) const
void remove (void)
void writeComplex (const QString &name, const QString &value)
void writeEntry (const QString &name, unsigned long value)
void writeEntry (const QString &name, unsigned int value)
void writeEntry (const QString &name, int value)
void writeEntry (const QString &name, bool value)
void writeEntry (const QString &name, const QString &value)
virtual ~ConfigBase (void)

Protected Member Functions

 ConfigBase (QDomElement configNode)
 ConfigBase (void)
QDomElement createComplexNode (const QString &name)
QDomElement createPropertyNode (const QString &name)
QDomElement findComplexNode (const QString &name) const
QDomElement findPropertyNode (const QString &name) const
QDomElement node (void) const
void setNode (QDomElement configNode)

Detailed Description

Encapsulates a XML configuration element.

Encapsulates a XML configuration node.

Author:
Martin Mueller <orvio@orvio.de>

Definition at line 36 of file blokkalconfigbase.h.


Constructor & Destructor Documentation

Blokkal::ConfigBase::~ConfigBase ( void   )  [virtual]

Destructor

Definition at line 44 of file blokkalconfigbase.cpp.

Blokkal::ConfigBase::ConfigBase ( void   )  [protected]

Creates a new ConfigBase with a null node as internal representation.

See also:
setNode()

Definition at line 34 of file blokkalconfigbase.cpp.

Blokkal::ConfigBase::ConfigBase ( QDomElement  configNode  )  [protected]

Creates a new ConfigBase

Parameters:
configNode the node that this object will use to store the data

Definition at line 39 of file blokkalconfigbase.cpp.


Member Function Documentation

QDomElement Blokkal::ConfigBase::createComplexNode ( const QString &  name  )  [protected]

Creates a new complex node.

Parameters:
name the complex name
Returns:
the new complex node

Definition at line 213 of file blokkalconfigbase.cpp.

QDomElement Blokkal::ConfigBase::createPropertyNode ( const QString &  name  )  [protected]

Creates a new property node.

Parameters:
name the property name
Returns:
the new property node

Definition at line 77 of file blokkalconfigbase.cpp.

QDomElement Blokkal::ConfigBase::findComplexNode ( const QString &  name  )  const [protected]

Returns the first complex node with this complex name or a null node, if it cannot find any.

Parameters:
name the name of the complex
Returns:
the first node with this complex name or a null node if such a node cannot be found

Definition at line 195 of file blokkalconfigbase.cpp.

QDomElement Blokkal::ConfigBase::findPropertyNode ( const QString &  name  )  const [protected]

Returns the first property node with this property name or a null node, if it cannot find any.

Parameters:
name the name of the property
Returns:
the first node with this property name or a null node if such a node cannot be found

Definition at line 59 of file blokkalconfigbase.cpp.

QDomElement Blokkal::ConfigBase::node ( void   )  const [protected]

Returns the encapsulated element.

Returns:
the encapsulated element

Definition at line 54 of file blokkalconfigbase.cpp.

bool Blokkal::ConfigBase::readBoolEntry ( const QString &  name,
bool  defaultValue = FALSE 
) const

Reads an entry from the config.

Parameters:
name name of the property
defaultValue defaultValue of the property. Used if no key with the given name can be found.
Returns:
the value of the property

Definition at line 116 of file blokkalconfigbase.cpp.

QString Blokkal::ConfigBase::readComplex ( const QString &  name,
const QString &  defaultValue = QString::null 
)

Reads an entry stored with writeComplex.

Parameters:
name of the complex
defaultValue the default value to use if the complex does not exist

Definition at line 184 of file blokkalconfigbase.cpp.

QString Blokkal::ConfigBase::readEntry ( const QString &  name,
const QString &  defaultValue = QString::null 
) const

Reads an entry from the config.

Parameters:
name name of the property
defaultValue defaultValue of the property. Used if no key with the given name can be found.
Returns:
the value of the property

Definition at line 105 of file blokkalconfigbase.cpp.

int Blokkal::ConfigBase::readIntEntry ( const QString &  name,
int  defaultValue = 0 
) const

Returns the value of the property entry name or defaultValue if the proprty entry does not exist or cannot be interpreted as an int.

Parameters:
name the property to read
defaultValue the value to use if the property entry does not exist

Definition at line 126 of file blokkalconfigbase.cpp.

unsigned int Blokkal::ConfigBase::readUIntEntry ( const QString &  name,
unsigned int  defaultValue = 0 
) const

Returns the value of the property entry name or defaultValue if the proprty entry does not exist or cannot be interpreted as an unsigned int.

Parameters:
name the property to read
defaultValue the value to use if the property entry does not exist

Definition at line 142 of file blokkalconfigbase.cpp.

unsigned long Blokkal::ConfigBase::readULongEntry ( const QString &  name,
unsigned long  defaultValue = FALSE 
) const

Returns the value of the property entry name or defaultValue if the proprty entry does not exist or cannot be interpreted as a ulong.

Parameters:
name the property to read
defaultValue the value to use if the property entry does not exist

Definition at line 153 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::remove ( void   ) 

Removes the encapsulated configuration node from the parent node. Do not use this object after calling this method.

Definition at line 85 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::setNode ( QDomElement  configNode  )  [protected]

Sets the internal node to configNode.

Definition at line 49 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeComplex ( const QString &  name,
const QString &  value 
)

Writes a complex entity to the config. If you need to store large properties, use this method rather than writeEntry().

Parameters:
name of the complex
value of the complex

Definition at line 169 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeEntry ( const QString &  name,
unsigned long  value 
)

Sets the value of a property entry.

Parameters:
name name of the property entry
value the new value of the property entry

Definition at line 164 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeEntry ( const QString &  name,
unsigned int  value 
)

Sets the value of a property entry.

Parameters:
name name of the property entry
value the new value of the property entry

Definition at line 137 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeEntry ( const QString &  name,
int  value 
)

Sets the value of a property entry.

Parameters:
name name of the property entry
value the new value of the property entry

Definition at line 121 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeEntry ( const QString &  name,
bool  value 
)

Writes an entry to the config.

Parameters:
name name of the property
value new value of the property

Definition at line 100 of file blokkalconfigbase.cpp.

void Blokkal::ConfigBase::writeEntry ( const QString &  name,
const QString &  value 
)

Writes an entry to the config.

Parameters:
name name of the property
value new value of the property
See also:
writeComplex()

Definition at line 90 of file blokkalconfigbase.cpp.


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