diff -r 15c3221e66af -r 6a4a348426d9 src/lib/SAXContentHandler.h --- a/src/lib/SAXContentHandler.h Sat Jun 12 19:15:58 2021 +0200 +++ b/src/lib/SAXContentHandler.h Sat Jun 12 20:31:23 2021 +0200 @@ -26,13 +26,14 @@ virtual ~SAXContentHandler() = default; - virtual void abc() = 0; // FIXME: remove dummy method - virtual void def(int a) = 0; // FIXME: remove dummy method - virtual void ghi(int a, int b) = 0; // FIXME: remove dummy method + virtual void writeStartElement(const std::string& name, const std::vector& attributes = {}) = 0; + virtual void writeEndElement() = 0; + virtual void writeCharacters(const std::string& text) = 0; + virtual void writeComment(const std::string& text, bool addSpaces = true) = 0; }; -class SAXContentHandlerProxy : public SAXContentHandler { +class SAXContentHandlerProxy : SAXContentHandler { private: std::vector> handlers; public: @@ -43,16 +44,20 @@ #define handler for (auto ___h : handlers) ___h - void abc() override { - handler->abc(); + void writeStartElement(const std::string& name, const std::vector& attributes = {}) { + handler->writeStartElement(name, attributes); } - void def(int a) override { - handler->def(a); + void writeEndElement() { + handler->writeEndElement(); } - void ghi(int a, int b) override { - handler->ghi(a, b); + void writeCharacters(const std::string& text) { + handler->writeCharacters(text); + } + + void writeComment(const std::string& text, bool addSpaces = true) { + handler->writeComment(text, addSpaces); } #undef handler