From f542c5ebb8068ccd4f9176684eb62183afbe7e5c Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Thu, 6 May 2010 20:28:36 +0000 Subject: Integrated changes from unicode branch to trunk git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640 --- tests/writer_string.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/writer_string.hpp (limited to 'tests/writer_string.hpp') diff --git a/tests/writer_string.hpp b/tests/writer_string.hpp new file mode 100644 index 0000000..1004fa0 --- /dev/null +++ b/tests/writer_string.hpp @@ -0,0 +1,27 @@ +#ifndef HEADER_WRITER_STRING_HPP +#define HEADER_WRITER_STRING_HPP + +#include "../src/pugixml.hpp" + +#include + +struct xml_writer_string: public pugi::xml_writer +{ + std::string contents; + + virtual void write(const void* data, size_t size); + + std::string as_narrow() const; + std::wstring as_wide() const; + std::basic_string as_string() const; +}; + +std::string save_narrow(const pugi::xml_document& doc, unsigned int flags, pugi::encoding_t encoding); +bool test_save_narrow(const pugi::xml_document& doc, unsigned int flags, pugi::encoding_t encoding, const char* expected, size_t length); + +std::string write_narrow(pugi::xml_node node, unsigned int flags, pugi::encoding_t encoding); +bool test_write_narrow(pugi::xml_node node, unsigned int flags, pugi::encoding_t encoding, const char* expected, size_t length); + +std::wstring write_wide(pugi::xml_node node, unsigned int flags, pugi::encoding_t encoding); + +#endif -- cgit v1.2.3