From 91f25f0510db32d627bf5ed7d4067b90e37f2f86 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 18:55:18 +0100 Subject: [PATCH] And another one --- src/libutil/xml-writer.cc | 37 ------------------------------------- src/libutil/xml-writer.hh | 6 ++---- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc index 16dfb6ddc..01794001b 100644 --- a/src/libutil/xml-writer.cc +++ b/src/libutil/xml-writer.cc @@ -71,18 +71,6 @@ void XMLWriter::writeEmptyElement(const string & name, } -void XMLWriter::writeCharData(const string & data) -{ - assert(!pendingElems.empty()); - for (unsigned int i = 0; i < data.size(); ++i) { - char c = data[i]; - if (c == '<') output << "<"; - else if (c == '&') output << "&"; - else output << c; - } -} - - void XMLWriter::writeAttrs(const XMLAttrs & attrs) { for (XMLAttrs::const_iterator i = attrs.begin(); i != attrs.end(); ++i) { @@ -103,29 +91,4 @@ void XMLWriter::writeAttrs(const XMLAttrs & attrs) } -#if 0 -int main(int argc, char * * argv) -{ - XMLWriter doc(cout); - - // OpenElement e(doc, "foo"); - - doc.openElement("foo"); - - doc.writeCharData("dit is een test &\n"); - doc.writeCharData("\n"); - - for (int i = 0; i < 5; ++i) { - XMLAttrs attrs; - attrs["a"] = "b"; - attrs["bla"] = "'&\">"; - XMLOpenElement e(doc, "item", attrs); - doc.writeCharData("x"); - } - - return 0; -} -#endif - - } diff --git a/src/libutil/xml-writer.hh b/src/libutil/xml-writer.hh index fee2eb495..3cefe3712 100644 --- a/src/libutil/xml-writer.hh +++ b/src/libutil/xml-writer.hh @@ -19,7 +19,7 @@ typedef map XMLAttrs; class XMLWriter { private: - + std::ostream & output; bool indent; @@ -40,8 +40,6 @@ public: void writeEmptyElement(const string & name, const XMLAttrs & attrs = XMLAttrs()); - - void writeCharData(const string & data); private: void writeAttrs(const XMLAttrs & attrs); @@ -67,5 +65,5 @@ public: } }; - + }