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-31 21:03:08 +0200
commit45521d593560b120d406acfb9926697e7ad5e423 (patch)
tree4d25de9d5aa29a029ac46e3bc6551a32491f8ea8 /src/saxparser.h
parentd172d756cfcdfbde5c6b8c6d25a51f58624739e6 (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 92197d1..4b1a273 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::unordered_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);
};