diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-09-05 21:23:44 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-09-05 21:23:44 +0000 |
commit | 50b89841463d7724e7e20dad19da8bd61d49a06c (patch) | |
tree | 14259e9596fd741d922b881bc8e3df0d647f4281 /src/stable/stdstream.cpp | |
parent | e62311adb3ad71a4a04521544fb12070336f17d2 (diff) | |
download | libbu++-50b89841463d7724e7e20dad19da8bd61d49a06c.tar.gz libbu++-50b89841463d7724e7e20dad19da8bd61d49a06c.tar.bz2 libbu++-50b89841463d7724e7e20dad19da8bd61d49a06c.tar.xz libbu++-50b89841463d7724e7e20dad19da8bd61d49a06c.zip |
Bu::StdStream can be set to print to stderror now, and sio.h now declares serr
and serrRaw. Also, they are now StreamStacks, which means you can change what
type of stream they read/write to, and also add filters.
Diffstat (limited to 'src/stable/stdstream.cpp')
-rw-r--r-- | src/stable/stdstream.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/stable/stdstream.cpp b/src/stable/stdstream.cpp index 9bc22f2..25ad8d4 100644 --- a/src/stable/stdstream.cpp +++ b/src/stable/stdstream.cpp | |||
@@ -8,7 +8,8 @@ | |||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include "bu/stdstream.h" | 9 | #include "bu/stdstream.h" |
10 | 10 | ||
11 | Bu::StdStream::StdStream() | 11 | Bu::StdStream::StdStream( OutMode eOut ) : |
12 | eOut( eOut ) | ||
12 | { | 13 | { |
13 | } | 14 | } |
14 | 15 | ||
@@ -27,7 +28,7 @@ Bu::size Bu::StdStream::read( void *pBuf, Bu::size nBytes ) | |||
27 | 28 | ||
28 | Bu::size Bu::StdStream::write( const void *pBuf, Bu::size nBytes ) | 29 | Bu::size Bu::StdStream::write( const void *pBuf, Bu::size nBytes ) |
29 | { | 30 | { |
30 | return fwrite( pBuf, 1, nBytes, stdout ); | 31 | return fwrite( pBuf, 1, nBytes, eOut==StdOut?stdout:stderr ); |
31 | } | 32 | } |
32 | 33 | ||
33 | Bu::size Bu::StdStream::tell() | 34 | Bu::size Bu::StdStream::tell() |
@@ -59,7 +60,7 @@ bool Bu::StdStream::isOpen() | |||
59 | 60 | ||
60 | void Bu::StdStream::flush() | 61 | void Bu::StdStream::flush() |
61 | { | 62 | { |
62 | fflush( stdout ); | 63 | fflush( eOut==StdOut?stdout:stderr ); |
63 | } | 64 | } |
64 | 65 | ||
65 | bool Bu::StdStream::canRead() | 66 | bool Bu::StdStream::canRead() |