aboutsummaryrefslogtreecommitdiff
path: root/src/stable/stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/stable/stream.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/stable/stream.cpp b/src/stable/stream.cpp
index 23a7f0f..551d657 100644
--- a/src/stable/stream.cpp
+++ b/src/stable/stream.cpp
@@ -17,37 +17,37 @@ Bu::Stream::~Stream()
17 17
18Bu::String Bu::Stream::readLine() 18Bu::String Bu::Stream::readLine()
19{ 19{
20 Bu::String sRet; 20 Bu::String sRet;
21 21
22 for(;;) 22 for(;;)
23 { 23 {
24 char s; 24 char s;
25 if( read( &s, 1 ) == 0 ) 25 if( read( &s, 1 ) == 0 )
26 return sRet; 26 return sRet;
27 if( s == '\n' || s == '\r' ) 27 if( s == '\n' || s == '\r' )
28 return sRet; 28 return sRet;
29 sRet.append( s ); 29 sRet.append( s );
30 } 30 }
31} 31}
32 32
33Bu::String Bu::Stream::readAll() 33Bu::String Bu::Stream::readAll()
34{ 34{
35 Bu::String sRet; 35 Bu::String sRet;
36 char buf[4096]; 36 char buf[4096];
37 37
38 while( !isEos() ) 38 while( !isEos() )
39 { 39 {
40 int iRead = read( buf, 4096 ); 40 int iRead = read( buf, 4096 );
41 if( iRead == 0 ) 41 if( iRead == 0 )
42 return sRet; 42 return sRet;
43 sRet.append( buf, iRead ); 43 sRet.append( buf, iRead );
44 } 44 }
45 45
46 return sRet; 46 return sRet;
47} 47}
48 48
49Bu::size Bu::Stream::write( const Bu::String &sBuf ) 49Bu::size Bu::Stream::write( const Bu::String &sBuf )
50{ 50{
51 return write( sBuf.getStr(), sBuf.getSize() ); 51 return write( sBuf.getStr(), sBuf.getSize() );
52} 52}
53 53