summaryrefslogtreecommitdiff
path: root/server/src/macroheaderparser.h
diff options
context:
space:
mode:
authordeva <deva>2009-07-30 11:31:35 +0000
committerdeva <deva>2009-07-30 11:31:35 +0000
commit8d279b1839cb33de534c907c0731ddb3e4b7159e (patch)
tree8d4a39e0999c07f2eee92e35094020a86f9c1cc9 /server/src/macroheaderparser.h
parented33082fd43cf88f5edb2509f4abcd847bb6841a (diff)
Doxygen documented the Macro-/TemplateHeaderParser header files.
Diffstat (limited to 'server/src/macroheaderparser.h')
-rw-r--r--server/src/macroheaderparser.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/src/macroheaderparser.h b/server/src/macroheaderparser.h
index 28c5578..0bc58ed 100644
--- a/server/src/macroheaderparser.h
+++ b/server/src/macroheaderparser.h
@@ -31,12 +31,40 @@
#include "saxparser.h"
#include "template.h"
+/**
+ * Partial macro parser.
+ * This class is used to parse only the first tag of a macro xml file.
+ * The parser will run about 10 times faster than the one parsing the entire file
+ * (see the MacroParser class) and can be used to make a list of which macros are in
+ * which files.
+ * This class inherits the SAXParser baseclass.
+ * Use the parse() method to run the parser, and collect the result via the
+ * getMacro() method.
+ * If the file does not contain a macro, or the files is not a valid xml file, an
+ * Exception will be thrown.
+ */
class MacroHeaderParser : public SAXParser {
public:
+ /**
+ * Constructor.
+ * @param macrofile A std::string containing the name of the file to parse.
+ */
MacroHeaderParser(std::string macrofile);
+
+ /**
+ * Destructor.
+ * Frees the allocated Macro* (if any).
+ */
~MacroHeaderParser();
+ /**
+ * 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:
Macro *getMacro();
protected:
+ /**
+ * Overloaded parser callback method.
+ */
int readData(char *data, size_t size);
private: