diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-04-02 14:33:55 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-04-02 14:33:55 +0000 |
commit | e9e5da32b2e154698482b7ec6b7ab2098cd849c8 (patch) | |
tree | 1e9d2168a27b3979398285909dd10c362c03545a /src/formatter.cpp | |
parent | b4ab27db8a97f0a56a61bd56480cfbe08a1f3399 (diff) | |
download | libbu++-e9e5da32b2e154698482b7ec6b7ab2098cd849c8.tar.gz libbu++-e9e5da32b2e154698482b7ec6b7ab2098cd849c8.tar.bz2 libbu++-e9e5da32b2e154698482b7ec6b7ab2098cd849c8.tar.xz libbu++-e9e5da32b2e154698482b7ec6b7ab2098cd849c8.zip |
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.
Diffstat (limited to 'src/formatter.cpp')
-rw-r--r-- | src/formatter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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 ) | |||
176 | switch( s ) | 176 | switch( s ) |
177 | { | 177 | { |
178 | case Formatter::nl: | 178 | case Formatter::nl: |
179 | rOut.write("\n", 1 ); | 179 | { |
180 | char ci = rOut.getIndentChar(); | 180 | rOut.write("\n", 1 ); |
181 | for( int j = 0; j < rOut.getIndent(); j++ ) | 181 | char ci = rOut.getIndentChar(); |
182 | rOut.write( &ci, 1 ); | 182 | for( int j = 0; j < rOut.getIndent(); j++ ) |
183 | rOut.write( &ci, 1 ); | ||
184 | } | ||
185 | break; | ||
186 | |||
187 | case Formatter::flush: | ||
188 | rOut.doFlush(); | ||
183 | break; | 189 | break; |
184 | } | 190 | } |
185 | return rOut; | 191 | return rOut; |