LibEngsas
Public Member Functions | Private Attributes | List of all members
EXmlParserItem Class Reference

Used to connect tagNames to EXmlItem's. More...

#include <exmlparseritem.h>

+ Collaboration diagram for EXmlParserItem:

Public Member Functions

 EXmlParserItem (QString tagName, EXmlItem *(*callback)(EXmlModel *), EXmlModel *model)
 
 ~EXmlParserItem ()
 
EXmlItemload (QDomElement element, EXmlItem *parent, QMap< QString, EXmlParserItem * > parser)
 
QString tagName () const
 

Private Attributes

QString myTagName
 
EXmlItem *(* callback )(EXmlModel *)
 
EXmlModelmodel
 

Detailed Description

Used to connect tagNames to EXmlItem's.

The given callback function is used to create an instance of the connected EXmlItem Implementation when load is called. The pointer to EXmlModel is used to provide it to the create callback function.

Note
tagName() is turned into lowercase.

Constructor & Destructor Documentation

EXmlParserItem::EXmlParserItem ( QString  tagName,
EXmlItem *(*)(EXmlModel *)  callback,
EXmlModel model 
)

tagName is the name of the tag, which can be handle callback is the function, which can be used to create an instance of the EXmlItem implementation, which can handle tagName model is the pointer the EXmlModel, which should be passed to callback, if called.

EXmlParserItem::~EXmlParserItem ( )
inline

Member Function Documentation

EXmlItem * EXmlParserItem::load ( QDomElement  element,
EXmlItem parent,
QMap< QString, EXmlParserItem * >  parser 
)

Calls the callback function to create an instance of EXmlItem. Afterwards it sets the parent of the returned item and calls EXmlItem::load() afterwards to load the XML data. The parameter model contains a pointer to the model, where the created EXmlItem is used in.

+ Here is the call graph for this function:

QString EXmlParserItem::tagName ( ) const

+ Here is the caller graph for this function:

Member Data Documentation

EXmlItem*(* EXmlParserItem::callback)(EXmlModel *)
private
EXmlModel* EXmlParserItem::model
private
QString EXmlParserItem::myTagName
private

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