#include <qgarlib/QgarAppDescr.H>
Inheritance diagram for qgar::QgarAppDescr:

Each Qgar application is linked to an XML document containing its description and the description of its parameter.
The main elements of the description are:
This class allows the user to create a representation of such a description by taking care of the parsing of the XML document. Once this representation is created, the user can query the various elements composing the description.
Each parameter description is stored into an instance of class qgar::QgarAppParamDescr.
The user may also serialize instances of this class to XML using the qgar::QgarAppDescr::toXml() function member.
Definition at line 112 of file QgarAppDescr.H.
Data Used for Parsing | |
| enum | ParseState { MAIN, PARAM } |
| qgar::QgarAppDescr::ParseData * | _parseData |
| Structure holding all the data used while parsing.
Using a structure to regroup all these data allows to dynamically allocate the room to store it. This space can the be desallocated when parsing is over. This means the that the overall memory cost for these data is 1 pointer size when no parsing is performed. A pointer to the struct holding parsing data. | |
Public Member Functions | |
Constructors | |
| QgarAppDescr (const char *const filename) throw (std::runtime_error) | |
| Build a QgarAppDescr from a file. | |
| QgarAppDescr (const std::string &filename) throw (std::runtime_error) | |
| Build a QgarAppDescr from a string. | |
| QgarAppDescr (std::istream &stream) throw (std::runtime_error) | |
| Build a QgarAppDescr from an input stream. | |
| QgarAppDescr (const std::string &name, const std::string ©right, const std::string &briefDoc, const std::string &longDoc, const std::vector< QgarAppParamDescr * > ¶mVect) | |
| Build a QgarAppDescr from given data. | |
| QgarAppDescr (const QgarAppDescr &) | |
| Copy constructor. | |
Destructors | |
| virtual | ~QgarAppDescr () |
| Destructor. | |
Parameters | |
| void | addParamDescr (QgarAppParamDescr *descr) |
| Add the description of a parameter. | |
XML Serialization | |
| std::string | toXml () const |
| Builds an XML document representating this application description. | |
DefaultHandler Redefinitions | |
| virtual void | characters (const char *ch, const unsigned int start, const unsigned int length) |
| virtual void | startElement (const std::string &uri, const std::string &localName, const std::string &qName, const qgxml::Attributes &atts) |
| virtual void | endElement (const std::string &uri, const std::string &localName, const std::string &qName) |
| virtual void | fatalError (const qgxml::SAXParseException &exception) |
Access | |
| std::string | name () const |
| Retrieve the name of the application. | |
| std::string | author () const |
| Retrieve the author of the application. | |
| std::string | copyright () const |
| Retrieve the copyright notice attached to the application. | |
| std::string | briefDoc () const |
| Retrieve the brief documentation of the application. | |
| std::string | longDoc () const |
| Retrieve the detailed documentation for the application. | |
| std::vector< QgarAppParamDescr * > | paramVect () const |
| Retrieve the description of the parameters of the application. | |
| const std::string & | accessName () const |
| Access to the name of the application. | |
| const std::string & | accessAuthor () const |
| Access to the author information of the application. | |
| const std::string & | accessCopyright () const |
| Access to the copyright notice attached to the application. | |
| const std::string & | accessBriefDoc () const |
| Access to the brief documentation of the application. | |
| const std::string & | accessLongDoc () const |
| Access to the detailed documentation of the application. | |
| const std::vector< QgarAppParamDescr * > & | accessParamVect () const |
| Access to the descriptions of the parameters of the application. | |
Transformation | |
| void | setName (const std::string &name) |
| Sets the name of the application. | |
| void | setAuthor (const std::string &author) |
| Sets the name of the author of the application. | |
| void | setCopyright (const std::string ©right) |
| Sets the copyright notice for the application. | |
| void | setBriefDoc (const std::string &briefDoc) |
| Sets the brief documentation of the application. | |
| void | setLongDoc (const std::string &longDoc) |
| Sets the detailed documentation of the application. | |
| void | setParamVect (const std::vector< QgarAppParamDescr * > ¶mVect) |
| Sets the descriptions of the application parameters. | |
Operators | |
| QgarAppDescr & | operator= (const QgarAppDescr &rhs) |
| Assignment operator. | |
ContentHandler Impl | |
| virtual void | endDocument () |
| Receive notification of the end of a document. | |
| virtual void | endPrefixMapping (const std::string &prefix) |
| End the scope of a prefix-URI mapping. | |
| virtual void | ignorableWhitespace (const char *ch, const unsigned int start, const unsigned int length) |
| Receive notification of ignorable whitespace in element content. | |
| virtual void | processingInstruction (const std::string &target, const std::string &data) |
| Receive notification of a processing instruction. | |
| virtual void | setDocumentLocator (Locator *locator) |
| Receive an object for locating the origin of SAX document events. | |
| virtual void | skippedEntity (const std::string &name) |
| Receive notification of a skipped entity. | |
| virtual void | startDocument () |
| Receive notification of the beginning of a document. | |
| virtual void | startPrefixMapping (const std::string &prefix, const std::string &uri) |
| Begin the scope of a prefix-URI Namespace mapping. | |
DTDHandler Impl | |
| virtual void | notationDecl (const std::string &name, const std::string &publicId, const std::string &systemId) |
| Receive notification of a notation declaration event. | |
| virtual void | unparsedEntityDecl (const std::string &name, const std::string &publicId, const std::string &systemId, const std::string ¬ationName) |
| Receive notification of an unparsed entity declaration event. | |
EntityResolver Impl | |
| virtual InputSource * | resolveEntity (const std::string &publicId, const std::string &systemId) |
| Allow the application to resolve external entities. | |
ErrorHandler Impl | |
| virtual void | error (const SAXParseException &exception) |
| Receive notification of a recoverable error. | |
| virtual void | warning (const SAXParseException &exception) |
| Receive notification of a warning. | |
Static Public Attributes | |
TAGs | |
The tags composing the XML document describing an application description. | |
| static const char *const | ELT_APPLICATION = "application" |
| static const char *const | ELT_DESCR = "descr" |
| static const char *const | ELT_DOCUMENTATION = "documentation" |
| static const char *const | ELT_PARAMLIST = "paramlist" |
| static const char *const | ELT_PARAM = "param" |
| static const char *const | ELT_NAME = "name" |
| static const char *const | ELT_AUTHOR = "author" |
| static const char *const | ELT_COPYRIGHT = "copyright" |
| static const char *const | ELT_DOC = "doc" |
| static const char *const | ELT_BRIEF = "brief" |
| static const char *const | ELT_LONG = "long" |
| static const char *const | ATT_REVISION = "revision" |
| static const char *const | ATT_LANG = "lang" |
| static const char *const | ATT_NAME = "name" |
| static const char *const | ATT_FLAG = "flag" |
| static const char *const | ATT_REQUIRED = "required" |
| static const char *const | ATT_PASSING_MODE = "passing-mode" |
| static const char *const | ATT_FORMAT = "format" |
| static const char *const | ATT_TYPE = "type" |
Protected Member Functions | |
| void | init (qgxml::InputSource source) throw (std::runtime_error) |
| Creates an instance from an XML document located by an input source. | |
Methods used for parsing elements | |
Theses methods are callbacks invoked from the DefaultHandler function members implementations. For internal use only.
| |
| void | startParam (const qgxml::Attributes &atts) |
| Callback invoked when the parser starts parsing a new parameter section. | |
| void | endParam () |
| Callback invoked when the parser has finished the parsing of a parameter section. | |
| void | endName () |
| Callback invoked when the parser has finished the parsing of the name section. | |
| void | endAuthor () |
| Callback invoked when the parser has finished the parsing of the author section. | |
| void | endCopyright () |
| Callabck invoked when the parser has finished the parsing of the copyright section. | |
| void | endBrief () |
| Callabck invoked when the parser has finished the parsing of the brief documentation section. | |
| void | endLong () |
| Callabck invoked when the parser has finished the parsing of the detailed documentation section. | |
Protected Attributes | |
| std::string | _name |
| The name of the application. | |
| std::string | _author |
| The author of the application. | |
| std::string | _copyright |
| The copyright notice. | |
| std::string | _briefDoc |
| The brief documentation. | |
| std::string | _longDoc |
| The documentation verbose version. | |
| std::vector< QgarAppParamDescr * > | _paramVect |
| The descriptions of the application parameters. | |
Classes | |
| struct | ParseData |
| Structure holding all the data used while parsing.
Using a structure to regroup all these data allows to dynamically allocate the room to store it. This space can the be desallocated when parsing is over. This means the that the overall memory cost for these data is 1 pointer size when no parsing is performed. More... | |
|
|
For internal use only.
Definition at line 589 of file QgarAppDescr.H. |
|
|
Build a QgarAppDescr from a file.
Definition at line 99 of file QgarAppDescr.C. |
|
|
Build a QgarAppDescr from a string.
|
|
|
Build a QgarAppDescr from an input stream.
|
|
||||||||||||||||||||||||
|
Build a QgarAppDescr from given data.
|
|
|
Copy constructor.
Definition at line 160 of file QgarAppDescr.C. References _paramVect, and _parseData. |
|
|
Destructor.
Definition at line 186 of file QgarAppDescr.C. References _paramVect, and _parseData. |
|
|
Access to the author information of the application.
Definition at line 403 of file QgarAppDescr.C. References _author. |
|
|
Access to the brief documentation of the application.
Definition at line 418 of file QgarAppDescr.C. References _briefDoc. |
|
|
Access to the copyright notice attached to the application.
Definition at line 410 of file QgarAppDescr.C. References _copyright. |
|
|
Access to the detailed documentation of the application.
Definition at line 426 of file QgarAppDescr.C. References _longDoc. |
|
|
Access to the name of the application.
Definition at line 395 of file QgarAppDescr.C. References _name. |
|
|
Access to the descriptions of the parameters of the application.
Definition at line 434 of file QgarAppDescr.C. References _paramVect. |
|
|
Add the description of a parameter.
Definition at line 201 of file QgarAppDescr.C. References _paramVect. Referenced by endParam(). |
|
|
Retrieve the author of the application.
Definition at line 348 of file QgarAppDescr.C. References _author. |
|
|
Retrieve the brief documentation of the application.
Definition at line 363 of file QgarAppDescr.C. References _briefDoc. |
|
||||||||||||||||
|
Reimplemented from qgxml::DefaultHandler. Definition at line 249 of file QgarAppDescr.C. References _parseData, and qgar::QgarAppDescr::ParseData::buffer. |
|
|
Retrieve the copyright notice attached to the application.
Definition at line 355 of file QgarAppDescr.C. References _copyright. |
|
|
Callback invoked when the parser has finished the parsing of the author section.
For internal use only. The author section is enclosed in a pair of <ELT_AUTHOR> <ELT_AUTHOR/> tags. Definition at line 664 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::buffer, and setAuthor(). |
|
|
Callabck invoked when the parser has finished the parsing of the brief documentation section.
For internal use only. The copyright section is enclosed in a pair of <ELT_BRIEF> <ELT_BRIEF/> tags. Definition at line 680 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::buffer, qgar::QgarAppDescr::ParseData::currentParam, MAIN, setBriefDoc(), and qgar::QgarAppDescr::ParseData::state. |
|
|
Callabck invoked when the parser has finished the parsing of the copyright section.
For internal use only. The copyright section is enclosed in a pair of <ELT_COPYRIGHT> <ELT_COPYRIGHT/> tags. Definition at line 672 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::buffer, and setCopyright(). |
|
|
Receive notification of the end of a document. The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.
Implements qgxml::ContentHandler. Definition at line 99 of file DefaultHandler.H. |
|
||||||||||||||||
|
Reimplemented from qgxml::DefaultHandler. |
|
|
Callabck invoked when the parser has finished the parsing of the detailed documentation section.
For internal use only. The copyright section is enclosed in a pair of <ELT_LONG> <ELT_LONG/> tags. Definition at line 692 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::buffer, qgar::QgarAppDescr::ParseData::currentParam, MAIN, setLongDoc(), and qgar::QgarAppDescr::ParseData::state. |
|
|
Callback invoked when the parser has finished the parsing of the name section.
For internal use only. The name section is enclosed in a pair of <ELT_NAME> </ELT_NAME> tags. Definition at line 656 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::buffer, and setName(). |
|
|
Callback invoked when the parser has finished the parsing of a parameter section.
For internal use only. The parameter sections are enclosed by <ELT_PARAM> tags.
Definition at line 645 of file QgarAppDescr.C. References _parseData, addParamDescr(), qgar::QgarAppDescr::ParseData::currentParam, MAIN, and qgar::QgarAppDescr::ParseData::state. |
|
|
End the scope of a prefix-URI mapping.
Implements qgxml::ContentHandler. Definition at line 109 of file DefaultHandler.H. |
|
|
Receive notification of a recoverable error.
Implements qgxml::ErrorHandler. Definition at line 182 of file DefaultHandler.H. |
|
|
Reimplemented from qgxml::DefaultHandler. Definition at line 330 of file QgarAppDescr.C. References qgxml::SAXException::getMessage(). |
|
||||||||||||||||
|
Receive notification of ignorable whitespace in element content.
Implements qgxml::ContentHandler. Definition at line 113 of file DefaultHandler.H. |
|
|
Creates an instance from an XML document located by an input source.
Definition at line 221 of file QgarAppDescr.C. References qgxml::XMLReader::parse(), and qgxml::XMLReader::setContentHandler(). |
|
|
Retrieve the detailed documentation for the application.
Definition at line 371 of file QgarAppDescr.C. References _longDoc. |
|
|
Retrieve the name of the application.
Definition at line 340 of file QgarAppDescr.C. References _name. |
|
||||||||||||||||
|
Receive notification of a notation declaration event.
Implements qgxml::DTDHandler. Definition at line 154 of file DefaultHandler.H. |
|
|
Assignment operator.
Definition at line 708 of file QgarAppDescr.C. References _briefDoc, _copyright, _longDoc, _name, _paramVect, and _parseData. |
|
|
Retrieve the description of the parameters of the application.
Definition at line 379 of file QgarAppDescr.C. References _paramVect. |
|
||||||||||||
|
Receive notification of a processing instruction.
Implements qgxml::ContentHandler. Definition at line 119 of file DefaultHandler.H. |
|
||||||||||||
|
Allow the application to resolve external entities.
Implements qgxml::EntityResolver. Definition at line 172 of file DefaultHandler.H. |
|
|
Sets the name of the author of the application.
Referenced by endAuthor(). |
|
|
Sets the brief documentation of the application.
Referenced by endBrief(). |
|
|
Sets the copyright notice for the application.
Referenced by endCopyright(). |
|
|
Receive an object for locating the origin of SAX document events.
Implements qgxml::ContentHandler. Definition at line 124 of file DefaultHandler.H. |
|
|
Sets the detailed documentation of the application.
Referenced by endLong(). |
|
|
Sets the name of the application.
Referenced by endName(). |
|
|
Sets the descriptions of the application parameters.
|
|
|
Receive notification of a skipped entity.
Implements qgxml::ContentHandler. Definition at line 128 of file DefaultHandler.H. |
|
|
Receive notification of the beginning of a document. The SAX parser will invoke this method only once, before any other event callbacks (except for setDocumentLocator()).
Implements qgxml::ContentHandler. Definition at line 132 of file DefaultHandler.H. |
|
||||||||||||||||||||
|
Reimplemented from qgxml::DefaultHandler. |
|
|
Callback invoked when the parser starts parsing a new parameter section.
For internal use only. The parameter sections are enclosed in a <ELT_PARAM> tag.
Definition at line 504 of file QgarAppDescr.C. References _parseData, qgar::QgarAppDescr::ParseData::currentParam, qgxml::Attributes::getLength(), qgxml::Attributes::getLocalName(), qgxml::Attributes::getValue(), PARAM, qgar::QgarAppParamDescr::QGE_DXF, qgar::QgarAppParamDescr::QGE_IMAGE, qgar::QgarAppParamDescr::QGE_IN, qgar::QgarAppParamDescr::QGE_INOUT, qgar::QgarAppParamDescr::QGE_INT, qgar::QgarAppParamDescr::QGE_NUM, qgar::QgarAppParamDescr::QGE_OUT, qgar::QgarAppParamDescr::QGE_PBM, qgar::QgarAppParamDescr::QGE_PGM, qgar::QgarAppParamDescr::QGE_PPM, qgar::QgarAppParamDescr::QGE_REAL, qgar::QgarAppParamDescr::QGE_SVG, qgar::QgarAppParamDescr::QGE_UNKNOWN_FORMAT, and qgar::QgarAppDescr::ParseData::state. |
|
||||||||||||
|
Begin the scope of a prefix-URI Namespace mapping.
Implements qgxml::ContentHandler. Definition at line 143 of file DefaultHandler.H. |
|
|
Builds an XML document representating this application description.
Definition at line 209 of file QgarAppDescr.C. |
|
||||||||||||||||||||
|
Receive notification of an unparsed entity declaration event.
Implements qgxml::DTDHandler. Definition at line 160 of file DefaultHandler.H. |
|
|
Receive notification of a warning.
Implements qgxml::ErrorHandler. Definition at line 190 of file DefaultHandler.H. |
|
|
The author of the application.
Definition at line 567 of file QgarAppDescr.H. Referenced by accessAuthor(), and author(). |
|
|
The brief documentation.
Definition at line 573 of file QgarAppDescr.H. Referenced by accessBriefDoc(), briefDoc(), and operator=(). |
|
|
The copyright notice.
Definition at line 570 of file QgarAppDescr.H. Referenced by accessCopyright(), copyright(), and operator=(). |
|
|
The documentation verbose version.
Definition at line 576 of file QgarAppDescr.H. Referenced by accessLongDoc(), longDoc(), and operator=(). |
|
|
The name of the application.
Definition at line 564 of file QgarAppDescr.H. Referenced by accessName(), name(), and operator=(). |
|
|
The descriptions of the application parameters.
Definition at line 579 of file QgarAppDescr.H. Referenced by accessParamVect(), addParamDescr(), operator=(), paramVect(), QgarAppDescr(), and ~QgarAppDescr(). |
|
|
Definition at line 86 of file QgarAppDescr.C. |
|
|
Definition at line 89 of file QgarAppDescr.C. |
|
|
Definition at line 84 of file QgarAppDescr.C. |
|
|
Definition at line 85 of file QgarAppDescr.C. |
|
|
Definition at line 88 of file QgarAppDescr.C. |
|
|
Definition at line 87 of file QgarAppDescr.C. |
|
|
Definition at line 83 of file QgarAppDescr.C. |
|
|
Definition at line 90 of file QgarAppDescr.C. |
|
|
Definition at line 71 of file QgarAppDescr.C. |
|
|
Definition at line 77 of file QgarAppDescr.C. |
|
|
Definition at line 80 of file QgarAppDescr.C. |
|
|
Definition at line 78 of file QgarAppDescr.C. |
|
|
Definition at line 72 of file QgarAppDescr.C. |
|
|
Definition at line 79 of file QgarAppDescr.C. |
|
|
Definition at line 73 of file QgarAppDescr.C. |
|
|
Definition at line 81 of file QgarAppDescr.C. |
|
|
Definition at line 76 of file QgarAppDescr.C. |
|
|
Definition at line 75 of file QgarAppDescr.C. |
|
|
Definition at line 74 of file QgarAppDescr.C. |