aboutsummaryrefslogtreecommitdiff
path: root/src/stable/stdstream.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-09-05 21:23:44 +0000
committerMike Buland <eichlan@xagasoft.com>2012-09-05 21:23:44 +0000
commit50b89841463d7724e7e20dad19da8bd61d49a06c (patch)
tree14259e9596fd741d922b881bc8e3df0d647f4281 /src/stable/stdstream.cpp
parente62311adb3ad71a4a04521544fb12070336f17d2 (diff)
downloadlibbu++-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.cpp7
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
11Bu::StdStream::StdStream() 11Bu::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
28Bu::size Bu::StdStream::write( const void *pBuf, Bu::size nBytes ) 29Bu::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
33Bu::size Bu::StdStream::tell() 34Bu::size Bu::StdStream::tell()
@@ -59,7 +60,7 @@ bool Bu::StdStream::isOpen()
59 60
60void Bu::StdStream::flush() 61void Bu::StdStream::flush()
61{ 62{
62 fflush( stdout ); 63 fflush( eOut==StdOut?stdout:stderr );
63} 64}
64 65
65bool Bu::StdStream::canRead() 66bool Bu::StdStream::canRead()