summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h
index 0fec435e778..db45152dde9 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.h
@@ -25,16 +25,16 @@
#include <map>
#include <ostream>
#include <string>
+#include <vector>
-#include "SpecialActions.h"
-
-struct XMLNode
+class XMLNode
{
- virtual ~XMLNode () {}
- virtual XMLNode* clone () const =0;
- virtual void clear () =0;
- virtual std::ostream& write (std::ostream &os) const =0;
+ public:
+ virtual ~XMLNode () {}
+ virtual XMLNode* clone () const =0;
+ virtual void clear () =0;
+ virtual std::ostream& write (std::ostream &os) const =0;
};
@@ -96,7 +96,7 @@ class XMLCommentNode : public XMLNode
XMLCommentNode (const std::string &str) : _text(str) {}
XMLCommentNode* clone () const {return new XMLCommentNode(*this);}
void clear () {_text.clear();}
- std::ostream& write (std::ostream &os) const {return os << "<!--" << _text << "-->\n";}
+ std::ostream& write (std::ostream &os) const {return os << "<!--" << _text << "-->";}
private:
std::string _text;
@@ -115,4 +115,10 @@ class XMLCDataNode : public XMLNode
std::string _data;
};
+
+inline std::ostream& operator << (std::ostream &os, const XMLElementNode &node) {return node.write(os);}
+inline std::ostream& operator << (std::ostream &os, const XMLTextNode &node) {return node.write(os);}
+inline std::ostream& operator << (std::ostream &os, const XMLCommentNode &node) {return node.write(os);}
+inline std::ostream& operator << (std::ostream &os, const XMLCDataNode &node) {return node.write(os);}
+
#endif