From 680c646011ec55dd4c639a5b61d8c42a10272ae2 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 24 Jul 2009 16:05:18 +0000 Subject: More extensive testing, and documentation in the header files. --- server/src/queryparser.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'server/src/queryparser.h') diff --git a/server/src/queryparser.h b/server/src/queryparser.h index 947767c..3a73aa2 100644 --- a/server/src/queryparser.h +++ b/server/src/queryparser.h @@ -27,27 +27,47 @@ #ifndef __PRACRO_QUERYPARSER_H__ #define __PRACRO_QUERYPARSER_H__ -#include - -#include "queryresult.h" #include "saxparser.h" +#include #include +#include "queryresult.h" #include "utf8.h" +#include "exception.h" /** - * This class parses xml entyties into a QueryResult structure. + * This class parses xml entities into a QueryResult structure. + * Call the parent (SAXParser) method parse in order to actually parse something. + * If the parser fails (syntax error) it will throw an Exception. + * @see QueryResult result, in order to get the parsed data. */ class QueryParser : public SAXParser { public: + /** + * Constructor. + */ QueryParser(); + /** + * The object will contain the result when the parsing is done. + */ + QueryResult result; + + /** + * Private parser callback. + */ void startTag(std::string name, std::map< std::string, std::string> attributes); + + /** + * Private parser callback. + */ void endTag(std::string name); - void parseError(char *buf, size_t len, std::string error, int lineno); - QueryResult result; + /** + * Private parser callback. + */ + void parseError(char *buf, size_t len, std::string error, int lineno); private: // For read -- cgit v1.2.3