From e2605ba3c9ca35524b0c86e74ffa37bee548aef3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Jun 2012 11:00:52 +0200 Subject: Add support for specifying output stream type (--stream-type) --- cli/runtime-header.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'cli/runtime-header.cxx') diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx index f0b3cc1..4e9ba59 100644 --- a/cli/runtime-header.cxx +++ b/cli/runtime-header.cxx @@ -48,6 +48,8 @@ generate_runtime_header (context& ctx) // Exceptions. // + string const& os_type (ctx.options.ostream_type ()); + os << "// Exceptions." << endl << "//" << endl << endl; @@ -56,11 +58,11 @@ generate_runtime_header (context& ctx) << "{" << "public:" << endl << "virtual void" << endl - << "print (std::ostream&) const = 0;" + << "print (" << os_type << "&) const = 0;" << "};"; - os << "std::ostream&" << endl - << "operator<< (std::ostream&, const exception&);" + os << os_type << "&" << endl + << "operator<< (" << os_type << "&, const exception&);" << endl; os << "class unknown_option: public exception" @@ -75,7 +77,7 @@ generate_runtime_header (context& ctx) << "option () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -96,7 +98,7 @@ generate_runtime_header (context& ctx) << "argument () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -117,7 +119,7 @@ generate_runtime_header (context& ctx) << "option () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -142,7 +144,7 @@ generate_runtime_header (context& ctx) << "value () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -156,7 +158,7 @@ generate_runtime_header (context& ctx) << "{" << "public:" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -176,7 +178,7 @@ generate_runtime_header (context& ctx) << "file () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" @@ -197,7 +199,7 @@ generate_runtime_header (context& ctx) << "argument () const;" << endl << "virtual void" << endl - << "print (std::ostream&) const;" + << "print (" << os_type << "&) const;" << endl << "virtual const char*" << endl << "what () const throw ();" -- cgit v1.1