diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-23 21:57:41 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-29 22:43:32 +0200 |
commit | 6ac5946767ba41d7eff9eb8521519007fdc58750 (patch) | |
tree | 3ea70169dfe7568fa97c54c19a6f2de5189ef249 /src/saxparser.h | |
parent | ef1d7e4478649296ccb17900acc949a604097d66 (diff) |
More cleanup.
Diffstat (limited to 'src/saxparser.h')
-rw-r--r-- | src/saxparser.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/saxparser.h b/src/saxparser.h index b4d9823..8cfbdda 100644 --- a/src/saxparser.h +++ b/src/saxparser.h @@ -31,7 +31,8 @@ #include <expat.h> #include <fstream> -class SAXParser { +class SAXParser +{ public: SAXParser(); virtual ~SAXParser(); @@ -40,7 +41,8 @@ public: virtual int parseFile(const std::string& filename); //! Parses all the data in the buffer. - virtual int parseString(const std::string& str, const std::string& xml_source_name = ""); + virtual int parseString(const std::string& str, + const std::string& xml_source_name = ""); protected: using attr_t = std::map<std::string, std::string>; @@ -48,13 +50,16 @@ protected: virtual void characterData(const std::string& data) {} virtual void startTag(const std::string& name, const attr_t& attr) {} virtual void endTag(const std::string& name) {} - virtual void parseError(const std::string& buf, const std::string& error, const std::string& xml_source_name, std::size_t lineno); + virtual void parseError(const std::string& buf, + const std::string& error, + const std::string& xml_source_name, + std::size_t lineno); private: - XML_Parser p; + XML_Parser parser; std::string filename; - static void character_hndl(void* p, const XML_Char* s, int len); - static void start_hndl(void* p, const char* el, const char** attr); - static void end_hndl(void* p, const char* el); + static void characterHandler(void* parser, const XML_Char* cData, int len); + static void startHandler(void* parser, const char* el, const char** attr); + static void endHandler(void* parser, const char* el); }; |