summaryrefslogtreecommitdiff
path: root/cli/runtime-header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-15 11:00:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-15 11:00:52 +0200
commite2605ba3c9ca35524b0c86e74ffa37bee548aef3 (patch)
tree5ff3f5145fa9731895e2bf470efb7c94585331a8 /cli/runtime-header.cxx
parent5473563e9af0abbc81a3cfd7079c34fbc75dfdb4 (diff)
Add support for specifying output stream type (--stream-type)
Diffstat (limited to 'cli/runtime-header.cxx')
-rw-r--r--cli/runtime-header.cxx22
1 files changed, 12 insertions, 10 deletions
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 ();"