diff options
Diffstat (limited to '')
-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() |