From 7d850e5e8d79c9ca4485adf5602d3002ac1cae4e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 5 Sep 2012 21:28:02 +0000 Subject: Formatters can now be cast as Streams, or you can get the Stream out manually. --- src/stable/formatter.h | 3 +++ src/tests/print.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/stable/formatter.h b/src/stable/formatter.h index 9b9e501..d92a53b 100644 --- a/src/stable/formatter.h +++ b/src/stable/formatter.h @@ -247,6 +247,9 @@ namespace Bu void doFlush(); + Stream &getStream() { return rStream; } + operator Stream&() { return rStream; } + private: Stream &rStream; Fmt fLast; diff --git a/src/tests/print.cpp b/src/tests/print.cpp index 7a2fab2..0f9be6b 100644 --- a/src/tests/print.cpp +++ b/src/tests/print.cpp @@ -9,6 +9,7 @@ int main() Bu::println("This is unsubstituted?"); Bu::serr << "This is error text." << Bu::serr.nl; + Bu::println( Bu::serr, "This is also error text?"); return 0; } -- cgit v1.2.3