From ce9a4b7dc46827dd8ebd19750c7122d5aa54c565 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Mon, 12 Nov 2012 22:27:04 +0000 Subject: [PATCH] select correct cout or wcout --- .../XSLT/impl/xslt_compiled_stylesheet.hpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/include/XSLT/impl/xslt_compiled_stylesheet.hpp b/include/XSLT/impl/xslt_compiled_stylesheet.hpp index 9a76170d..86f17638 100644 --- a/include/XSLT/impl/xslt_compiled_stylesheet.hpp +++ b/include/XSLT/impl/xslt_compiled_stylesheet.hpp @@ -16,9 +16,31 @@ namespace Arabica namespace XSLT { +template +struct standard_stream +{ + static std::basic_ostream& out(); + static std::basic_ostream& err(); +}; + +template<> +struct standard_stream +{ + static std::basic_ostream& out() { return std::cout; } + static std::basic_ostream& err() { return std::cerr; } +}; + +template<> +struct standard_stream +{ + static std::basic_ostream& out() { return std::wcout; } + static std::basic_ostream& err() { return std::wcerr; } +}; + template class CompiledStylesheet : public Stylesheet { + typedef standard_stream streams; public: typedef Arabica::XPath::BoolValue BoolValue; typedef Arabica::XPath::NumericValue NumericValue; @@ -29,8 +51,8 @@ public: typedef DOM::NodeList DOMNodeList; CompiledStylesheet() : - output_(new StreamSink(std::wcout)), - error_output_(&std::wcerr) + output_(new StreamSink(streams::out())), + error_output_(&streams::err()) { } // CompiledStylesheet