XMLConfigReader Class Reference

Configuration file reading class. More...

#include <xmlconfigreader.h>

Collaboration diagram for XMLConfigReader:
Collaboration graph
[legend]

Public Member Functions

 XMLConfigReader (KockpitAuthObj &auth, KockpitBaseObj &user, KockpitBaseObj &group, QString *plugInPath, QString *scriptPath, QObject *parent=0)
 Constructor.
virtual ~XMLConfigReader ()
 Destructor.
bool readFile (const QString &fileName)
 Read file.

Protected Member Functions

bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
 Start element.
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
 End element.
bool characters (const QString &ch)
 Characters.
bool fatalError (const QXmlParseException &exception)
 Error handler.

Private Attributes

QString currentText
 Text between tags.
QString * plugInPath
 Pointer to plugin path - will be filled with configuration file entry.
QString * scriptPath
 Pointer to script path - will be filled with configuration file entry.
KockpitBaseObjuser
 Pointer to object with backend information associated with a KockpitUser object - will be filled with configuration file entry.
KockpitBaseObjgroup
 Pointer to object with backend information associated with a KockpitGroup object - will be filled with configuration file entry.
KockpitAuthObjauth
 Pointer to object with authentication information.
KockpitBaseObjcurrentObj
 Needed for internal use the separate KockpitBaseObj objects.

Detailed Description

Configuration file reading class.

This class is needed to read configuration files for the main application and plugins. The configuration files need to have a special format and are validated by XML schema.


Constructor & Destructor Documentation

XMLConfigReader::XMLConfigReader ( KockpitAuthObj auth,
KockpitBaseObj user,
KockpitBaseObj group,
QString *  plugInPath,
QString *  scriptPath,
QObject *  parent = 0 
)

Constructor.

Parameters:
auth Will be filled with configuration files entries.
user Will be filled with configuration files entries.
group Will be filled with configuration files entries.
plugInPath Will be filled with configuration file entries.
scriptPath Will be filled with configuration file entries.
parent Parent Object.
virtual XMLConfigReader::~XMLConfigReader (  )  [inline, virtual]

Destructor.


Member Function Documentation

bool XMLConfigReader::characters ( const QString &  ch  )  [protected]

Characters.

The function is needed to parse the text between xml tags.

Parameters:
ch String between tags
Returns:
true If everything is okay.
false If something went wrong (Parse error).
bool XMLConfigReader::endElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName 
) [protected]

End element.

The reader calls this function when it has parsed a end element tag.

Parameters:
namespaceURI Namespace URI.
localName Local name.
qName Qualified name.
Returns:
true If everything is okay.
false If something went wrong (Parse error).
bool XMLConfigReader::fatalError ( const QXmlParseException &  exception  )  [protected]

Error handler.

The function is needed to parse the text between xml tags.

Parameters:
exception String between tags
Returns:
false This is returned every thime this function is called.
bool XMLConfigReader::readFile ( const QString &  fileName  ) 

Read file.

If this function is called the specified configuration file will be read.

Parameters:
fileName Path to configuration file
Returns:
true If everything is okay.
false If something went wrong (Parse error).
bool XMLConfigReader::startElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName,
const QXmlAttributes &  atts 
) [protected]

Start element.

The reader calls this function when it has parsed a start element tag.

Parameters:
namespaceURI Namespace URI.
localName Local name.
qName Qualified name.
atts Attributes.
Returns:
true If everything is okay.
false If something went wrong (Parse error).

Field Documentation

Pointer to object with authentication information.

Needed for internal use the separate KockpitBaseObj objects.

QString XMLConfigReader::currentText [private]

Text between tags.

Pointer to object with backend information associated with a KockpitGroup object - will be filled with configuration file entry.

QString* XMLConfigReader::plugInPath [private]

Pointer to plugin path - will be filled with configuration file entry.

QString* XMLConfigReader::scriptPath [private]

Pointer to script path - will be filled with configuration file entry.

Pointer to object with backend information associated with a KockpitUser object - will be filled with configuration file entry.


The documentation for this class was generated from the following files:
Generated on Wed Mar 24 09:58:14 2010 for kockpit by  doxygen 1.6.3