From 17829dc5722c5811912dd7dc8806d79cf562893a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 6 Sep 2012 12:38:44 +0000 Subject: Just made the PrintEndAction private class a part of the Bu namespace. It really doesn't matter, but it's nicer for doxygen. --- src/stable/sio.cpp | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'src/stable') diff --git a/src/stable/sio.cpp b/src/stable/sio.cpp index 8ecb4ad..6a650ed 100644 --- a/src/stable/sio.cpp +++ b/src/stable/sio.cpp @@ -14,36 +14,39 @@ Bu::Formatter Bu::sio( Bu::sioRaw ); Bu::StreamStack Bu::serrRaw( new Bu::StdStream( Bu::StdStream::StdError ) ); Bu::Formatter Bu::serr( Bu::serrRaw ); -class PrintEndAction : public Bu::String::FormatProxyEndAction +namespace Bu { -public: - PrintEndAction( Bu::Stream &s, bool bEndLn ) : - s( s ), - bEndLn( bEndLn ) + class PrintEndAction : public Bu::String::FormatProxyEndAction { - } + public: + PrintEndAction( Bu::Stream &s, bool bEndLn ) : + s( s ), + bEndLn( bEndLn ) + { + } - virtual ~PrintEndAction() - { - } + virtual ~PrintEndAction() + { + } - virtual void operator()( const Bu::String &sFinal ) - { - s.write( sFinal.getStr(), sFinal.getSize() ); - if( bEndLn ) + virtual void operator()( const Bu::String &sFinal ) { - s.write("\n", 1); - s.flush(); + s.write( sFinal.getStr(), sFinal.getSize() ); + if( bEndLn ) + { + s.write("\n", 1); + s.flush(); + } } - } - Bu::Stream &s; - bool bEndLn; -}; + Bu::Stream &s; + bool bEndLn; + }; +} Bu::String::FormatProxy Bu::print( Bu::Stream &s, const Bu::String &str ) { - return str.format( new PrintEndAction( s, false ) ); + return str.format( new Bu::PrintEndAction( s, false ) ); } Bu::String::FormatProxy Bu::print( const Bu::String &str ) @@ -53,7 +56,7 @@ Bu::String::FormatProxy Bu::print( const Bu::String &str ) Bu::String::FormatProxy Bu::println( Bu::Stream &s, const Bu::String &str ) { - return str.format( new PrintEndAction( s, true ) ); + return str.format( new Bu::PrintEndAction( s, true ) ); } Bu::String::FormatProxy Bu::println( const Bu::String &str ) -- cgit v1.2.3