From f65e534f9d4c8323acc5e52c5eb3bd7d634d90b9 Mon Sep 17 00:00:00 2001 From: jez_higgins <> Date: Wed, 27 Aug 2003 14:28:41 +0000 Subject: [PATCH] wide string fixes --- examples/SAX/writer.cpp | 54 ++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/examples/SAX/writer.cpp b/examples/SAX/writer.cpp index 3455de88..440aafe4 100644 --- a/examples/SAX/writer.cpp +++ b/examples/SAX/writer.cpp @@ -17,30 +17,44 @@ int main(int argc, char* argv[]) return 0; } // if(argc < 2) +/* + { // narrow + SAX::FeatureNames fNames; + SAX::XMLReader parser; + SAX::Writer writer(std::cout); + writer.setParent(parser); - SAX::FeatureNames fNames; - SAX::XMLReader parser; - SAX::Writer writer(std::cout); - writer.setParent(parser); - - for(int i = 1; i < argc; ++i) - { - std::string file(argv[i]); - SAX::InputSource is; - is.setSystemId(file); - - if(file != "-") - writer.parse(is); - else + for(int i = 1; i < argc; ++i) { - is.setSystemId("stdin"); - is.setByteStream(std::cin); + std::string file(argv[i]); + SAX::InputSource is; + is.setSystemId(file); - writer.parse(is); - } // if(file != "-") - } // for ... + if(file != "-") + writer.parse(is); + else + { + is.setSystemId("stdin"); + is.setByteStream(std::cin); + + writer.parse(is); + } // if(file != "-") + } // for ... + } + */ + { // wide + SAX::FeatureNames fNames; + SAX::XMLReader parser; + SAX::wWriter writer(std::wcout); + writer.setParent(parser); + + SAX::wInputSource is; + is.setSystemId(L"stdin"); + is.setByteStream(std::cin); + + writer.parse(is); + } - return 0; } // main