From 32536521baaf91192dd6af8663ece4f354368982 Mon Sep 17 00:00:00 2001 From: inbei Date: Wed, 24 Apr 2019 18:30:17 +0800 Subject: [PATCH] Update pugixml.hpp writer to string --- src/pugixml.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pugixml.hpp b/src/pugixml.hpp index d01f15f..8fd3d23 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -324,6 +324,16 @@ namespace pugi }; #ifndef PUGIXML_NO_STL + //xml_writer implementation for string + class PUGIXML_CLASS xml_string_writer :public xml_writer + { + public: + xml_string_writer(std::string &str):xml(&str){}; + virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE; + private: + std::string* xml; + }; + // xml_writer implementation for streams class PUGIXML_CLASS xml_writer_stream: public xml_writer {