summaryrefslogtreecommitdiff
path: root/src/saxparser.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-03-23 21:57:41 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-03-23 21:57:41 +0100
commit91b3683ad0b6228bf85eefdb32e2ac3f717bd41c (patch)
tree8bdfae1492f2a658992d79faf85fab95a645c8bc /src/saxparser.h
parent5c04b951ffe53e1a31182bb0814908af8d7f0a6f (diff)
More cleanup.
Diffstat (limited to 'src/saxparser.h')
-rw-r--r--src/saxparser.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/saxparser.h b/src/saxparser.h
index b688e32..f4999af 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);
};