From 6e76c4540e37280d0c161e7d7035e2e9022b18ce Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 26 Mar 2008 13:04:30 +0000 Subject: Implemented a SAXPaser class, and made the macro and xml parsers use it. --- server/src/macro_parser.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'server/src/macro_parser.h') diff --git a/server/src/macro_parser.h b/server/src/macro_parser.h index 9f701d4..248e586 100644 --- a/server/src/macro_parser.h +++ b/server/src/macro_parser.h @@ -29,8 +29,26 @@ #include +#include "sax_parser.h" #include "macro.h" -void parse_macro(std::string name, Macro ¯o); +class MacroParser : public SAXParser { +public: + MacroParser(std::string name, Macro ¯o); + ~MacroParser(); + + void startTag(std::string name, std::map< std::string, std::string> attributes); + void endTag(std::string name); + +protected: + int readData(char *data, size_t size); + +private: + Macro *macro; + std::vector< Widget* > stack; + bool done; + + int fd; +}; #endif/*__PRACRO_MACRO_PARSER_H__*/ -- cgit v1.2.3