NCL Composer  0.1.5
 All Classes Functions Variables Pages
composer::language::NCLDocumentParser Class Referenceabstract
Inheritance diagram for composer::language::NCLDocumentParser:
Collaboration diagram for composer::language::NCLDocumentParser:

Public Slots

void onEntityAddError (QString error)
 
void onEntityAdded (QString ID, Entity *entity)
 
virtual void onEntityAdded (QString uniqueID, Entity *entity)=0
 This slot is called after the addEntity has success. More...
 

Signals

void parseFinished ()
 
void addEntity (QString type, QString parentEntityId, QMap< QString, QString > &atts, bool force)
 Signal emitted when the parser find a new entity. More...
 

Public Member Functions

 NCLDocumentParser (Project *project)
 
bool parseDocument ()
 Parses the content of the document. More...
 
bool parseContent (const QString &str)
 Parses the content of the string passed as parameter. More...
 
QString getParserName ()
 Returns the name of the Document Parser. More...
 
bool serialize ()
 

Protected Member Functions

bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attributes)
 
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
 
bool characters (const QString &str)
 
bool fatalError (const QXmlParseException &exception)
 
bool endDocument ()
 

Detailed Description

Definition at line 28 of file NCLDocumentParser.h.

Member Function Documentation

void composer::extension::IDocumentParser::addEntity ( QString  type,
QString  parentEntityId,
QMap< QString, QString > &  atts,
bool  force 
)
signalinherited

Signal emitted when the parser find a new entity.

This function must be implemented by concrete Document Parsers.

Parameters
typethe type of the entity (XML tagname).
parentEntityIduniqueId of the father.
attsattributes of this entity.
forcetrue if the entity must be added even if this cause an error in the model.
QString composer::language::NCLDocumentParser::getParserName ( )
virtual

Returns the name of the Document Parser.

This name should be unique. This function must be implemented by concrete Document Parsers.

Returns
QString the name of the Document Parser.

Implements composer::extension::IDocumentParser.

Definition at line 25 of file NCLDocumentParser.cpp.

virtual void composer::extension::IDocumentParser::onEntityAdded ( QString  uniqueID,
Entity entity 
)
pure virtualslotinherited

This slot is called after the addEntity has success.

This function must be implemented by concrete Document Parsers.

Parameters
uniqueIDthe unique id of the entity in the model.
entitythe pointer to the entity.
bool composer::language::NCLDocumentParser::parseContent ( const QString &  str)
virtual

Parses the content of the string passed as parameter.

This function must be implemented by concrete Document Parsers.

  • str the content to be parsed.
    Returns
    bool returns true if success and false otherwise.

Implements composer::extension::IDocumentParser.

Definition at line 51 of file NCLDocumentParser.cpp.

bool composer::language::NCLDocumentParser::parseDocument ( )
virtual

Parses the content of the document.

This function must be implemented by concrete Document Parsers.

Returns
bool returns true if success and false otherwise.

Implements composer::extension::IDocumentParser.

Definition at line 30 of file NCLDocumentParser.cpp.


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