summaryrefslogtreecommitdiff
path: root/include/xml.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/xml.hpp')
-rw-r--r--include/xml.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/xml.hpp b/include/xml.hpp
new file mode 100644
index 0000000..cc593a3
--- /dev/null
+++ b/include/xml.hpp
@@ -0,0 +1,28 @@
1#ifndef XML_HPP_INCLUDED
2#define XML_HPP_INCLUDED
3
4// Standard C++
5#include <iostream>
6#include <string>
7#include <vector>
8
9class XML {
10 public:
11 void parse(std::istream& in);
12
13 protected:
14 virtual void handle_start(const std::string& name, const std::vector<std::pair<std::string, std::string>>& attr) = 0;
15 virtual void handle_end(const std::string& name) = 0;
16 virtual void handle_cdata_start() {}
17 virtual void handle_cdata_end() {}
18 virtual void handle_data(const std::vector<char>&) {}
19
20 private:
21 static void tag_start(void* me, const char* name, const char* attr[]);
22 static void tag_end(void* me, const char* name);
23 static void cdata_start(void* me);
24 static void cdata_end(void* me);
25 static void data(void* me, const char* dat, int len);
26};
27
28#endif