aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-09-05 21:28:02 +0000
committerMike Buland <eichlan@xagasoft.com>2012-09-05 21:28:02 +0000
commit7d850e5e8d79c9ca4485adf5602d3002ac1cae4e (patch)
tree48bfddc2065656e7dba0fc4f2208638cccf0cb1f /src
parent50b89841463d7724e7e20dad19da8bd61d49a06c (diff)
downloadlibbu++-7d850e5e8d79c9ca4485adf5602d3002ac1cae4e.tar.gz
libbu++-7d850e5e8d79c9ca4485adf5602d3002ac1cae4e.tar.bz2
libbu++-7d850e5e8d79c9ca4485adf5602d3002ac1cae4e.tar.xz
libbu++-7d850e5e8d79c9ca4485adf5602d3002ac1cae4e.zip
Formatters can now be cast as Streams, or you can get the Stream out manually.
Diffstat (limited to '')
-rw-r--r--src/stable/formatter.h3
-rw-r--r--src/tests/print.cpp1
2 files changed, 4 insertions, 0 deletions
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
247 247
248 void doFlush(); 248 void doFlush();
249 249
250 Stream &getStream() { return rStream; }
251 operator Stream&() { return rStream; }
252
250 private: 253 private:
251 Stream &rStream; 254 Stream &rStream;
252 Fmt fLast; 255 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()
9 Bu::println("This is unsubstituted?"); 9 Bu::println("This is unsubstituted?");
10 10
11 Bu::serr << "This is error text." << Bu::serr.nl; 11 Bu::serr << "This is error text." << Bu::serr.nl;
12 Bu::println( Bu::serr, "This is also error text?");
12 13
13 return 0; 14 return 0;
14} 15}