From e9e5da32b2e154698482b7ec6b7ab2098cd849c8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 2 Apr 2009 14:33:55 +0000 Subject: Removed some uses of printf in libbu++, I would like to get rid of all of them some day, but I'm not in much of a rush, I just wanted to do a quick survey. Also added the Formatter::flush special stream value, so now you can do a: sio << "hello" << sio.flush; and it'll flush output immediately. I also tweaked a few things in the cachestore and cache so that they actually throw exceptions and the like instead of just printing out some garbage. --- src/formatter.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/formatter.cpp') diff --git a/src/formatter.cpp b/src/formatter.cpp index 2fadd96..8c06bde 100644 --- a/src/formatter.cpp +++ b/src/formatter.cpp @@ -176,10 +176,16 @@ Bu::Formatter &Bu::operator<<( Bu::Formatter &rOut, Bu::Formatter::Special s ) switch( s ) { case Formatter::nl: - rOut.write("\n", 1 ); - char ci = rOut.getIndentChar(); - for( int j = 0; j < rOut.getIndent(); j++ ) - rOut.write( &ci, 1 ); + { + rOut.write("\n", 1 ); + char ci = rOut.getIndentChar(); + for( int j = 0; j < rOut.getIndent(); j++ ) + rOut.write( &ci, 1 ); + } + break; + + case Formatter::flush: + rOut.doFlush(); break; } return rOut; -- cgit v1.2.3