From 0cf833840b19e603f480dead5ca211f947503f9b Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sun, 9 Mar 2025 22:26:25 +0100 Subject: Initial commit --- include/xml.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/xml.hpp (limited to 'include') 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 @@ +#ifndef XML_HPP_INCLUDED +#define XML_HPP_INCLUDED + +// Standard C++ +#include +#include +#include + +class XML { + public: + void parse(std::istream& in); + + protected: + virtual void handle_start(const std::string& name, const std::vector>& attr) = 0; + virtual void handle_end(const std::string& name) = 0; + virtual void handle_cdata_start() {} + virtual void handle_cdata_end() {} + virtual void handle_data(const std::vector&) {} + + private: + static void tag_start(void* me, const char* name, const char* attr[]); + static void tag_end(void* me, const char* name); + static void cdata_start(void* me); + static void cdata_end(void* me); + static void data(void* me, const char* dat, int len); +}; + +#endif -- cgit v1.3