XMLMapReader Class Reference

Mapping file reading class. More...

#include <xmlmapreader.h>

Collaboration diagram for XMLMapReader:
Collaboration graph
[legend]

Public Member Functions

 XMLMapReader (KockpitMap *kmap, QObject *parent=0)
 Constructor.
virtual ~XMLMapReader ()
 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.
attrmode toAttrMode (const QString &mode)
 Converter.

Private Attributes

KockpitMapkmap
 Object which is will be mapped on based on the configuration file.
QString currentText
 Text between tags.
objtype type
 Object Type of the object given by the constructor parameter.

Detailed Description

Mapping file reading class.

This class is needed to read mapping


Constructor & Destructor Documentation

XMLMapReader::XMLMapReader ( KockpitMap kmap,
QObject *  parent = 0 
)

Constructor.

Parameters:
kmap KockpitMap for which the mapping file should be used.
parent Parent Object.
virtual XMLMapReader::~XMLMapReader (  )  [inline, virtual]

Destructor.


Member Function Documentation

bool XMLMapReader::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 XMLMapReader::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 XMLMapReader::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 XMLMapReader::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 XMLMapReader::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).
attrmode XMLMapReader::toAttrMode ( const QString &  mode  )  [protected]

Converter.

Convert a given String to attribute mode

Parameters:
mode String representaion of attribute mode.
Returns:
attrmode Attribute mode.

Field Documentation

QString XMLMapReader::currentText [private]

Text between tags.

Object which is will be mapped on based on the configuration file.

Object Type of the object given by the constructor parameter.


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