summaryrefslogtreecommitdiff
path: root/src/stable/stream.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
commitec05778d5718a7912e506764d443a78d6a6179e3 (patch)
tree78a9a01532180030c095acefc45763f07c14edb8 /src/stable/stream.cpp
parentb20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff)
downloadlibbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip
Converted tabs to spaces with tabconv.
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