diff options
author | deva <deva> | 2009-07-30 11:31:35 +0000 |
---|---|---|
committer | deva <deva> | 2009-07-30 11:31:35 +0000 |
commit | 8d279b1839cb33de534c907c0731ddb3e4b7159e (patch) | |
tree | 8d4a39e0999c07f2eee92e35094020a86f9c1cc9 /server/src/templateheaderparser.h | |
parent | ed33082fd43cf88f5edb2509f4abcd847bb6841a (diff) |
Doxygen documented the Macro-/TemplateHeaderParser header files.
Diffstat (limited to 'server/src/templateheaderparser.h')
-rw-r--r-- | server/src/templateheaderparser.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/server/src/templateheaderparser.h b/server/src/templateheaderparser.h index 522f56d..e517f67 100644 --- a/server/src/templateheaderparser.h +++ b/server/src/templateheaderparser.h @@ -31,12 +31,40 @@ #include "saxparser.h" #include "template.h" +/** + * Partial template parser. + * This class is used to parse only the first tag of a template xml file. + * The parser will run about 10 times faster than the one parsing the entire file + * (see the TemplateParser class) and can be used to make a list of which templates are in + * which files. + * This class inherits the SAXParser baseclass. + * Use the parse() method to run the parser, and collect the result via the + * getTemplate() method. + * If the file does not contain a template, or the files is not a valid xml file, an + * Exception will be thrown. + */ class TemplateHeaderParser : public SAXParser { public: + /** + * Constructor. + * @param templatefile A std::string containing the name of the file to parse. + */ TemplateHeaderParser(std::string templatefile); + + /** + * Destructor. + * Frees the allocated Template* (if any). + */ ~TemplateHeaderParser(); + /** + * Overloaded parser callback method. + */ void startTag(std::string name, std::map< std::string, std::string> attributes); + + /** + * Overloaded parser callback method. + */ void parseError(char *buf, size_t len, std::string error, int lineno); /** @@ -48,6 +76,9 @@ public: Template *getTemplate(); protected: + /** + * Overloaded parser callback method. + */ int readData(char *data, size_t size); private: |