From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/substream.cpp | 88 ++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'src/stable/substream.cpp') diff --git a/src/stable/substream.cpp b/src/stable/substream.cpp index 7e3729b..c55dc04 100644 --- a/src/stable/substream.cpp +++ b/src/stable/substream.cpp @@ -8,12 +8,12 @@ #include "bu/substream.h" Bu::SubStream::SubStream( Bu::Stream &rNext, Bu::size iSize ) : - Bu::Filter( rNext ), - iStart( 0 ), - iPos( 0 ), - iSize( iSize ) + Bu::Filter( rNext ), + iStart( 0 ), + iPos( 0 ), + iSize( iSize ) { - iStart = rNext.tell(); + iStart = rNext.tell(); } Bu::SubStream::~SubStream() @@ -22,88 +22,88 @@ Bu::SubStream::~SubStream() Bu::size Bu::SubStream::read( void *pBuf, Bu::size nBytes ) { - if( (Bu::size)nBytes > iSize-iPos ) - nBytes = iSize-iPos; - nBytes = rNext.read( pBuf, nBytes ); - iPos += nBytes; - return nBytes; + if( (Bu::size)nBytes > iSize-iPos ) + nBytes = iSize-iPos; + nBytes = rNext.read( pBuf, nBytes ); + iPos += nBytes; + return nBytes; } Bu::size Bu::SubStream::write( const void *pBuf, Bu::size nBytes ) { - if( (Bu::size)nBytes > iSize-iPos ) - nBytes = iSize-iPos; - nBytes = rNext.write( pBuf, nBytes ); - iPos += nBytes; - return nBytes; + if( (Bu::size)nBytes > iSize-iPos ) + nBytes = iSize-iPos; + nBytes = rNext.write( pBuf, nBytes ); + iPos += nBytes; + return nBytes; } void Bu::SubStream::start() { - // doesn't mean anything... + // doesn't mean anything... } Bu::size Bu::SubStream::stop() { - // doesn't mean anything... - return 0; + // doesn't mean anything... + return 0; } void Bu::SubStream::close() { - // don't do anything? maybe... + // don't do anything? maybe... } Bu::size Bu::SubStream::tell() { - return iPos; + return iPos; } void Bu::SubStream::seek( Bu::size offset ) { - if( iPos+offset < 0 ) - offset = -iPos; - else if( iPos+offset > iSize ) - offset = iSize-iPos; - rNext.seek( offset ); - iPos += offset; + if( iPos+offset < 0 ) + offset = -iPos; + else if( iPos+offset > iSize ) + offset = iSize-iPos; + rNext.seek( offset ); + iPos += offset; } void Bu::SubStream::setPos( Bu::size pos ) { - if( pos < 0 ) - pos = 0; - else if( pos > iSize ) - pos = iSize; - iPos = pos; - pos += iStart; - rNext.setPos( pos ); + if( pos < 0 ) + pos = 0; + else if( pos > iSize ) + pos = iSize; + iPos = pos; + pos += iStart; + rNext.setPos( pos ); } void Bu::SubStream::setPosEnd( Bu::size pos ) { - if( iSize-pos < 0 ) - pos = 0; - else if( iSize-pos > iSize ) - pos = iSize; - else - pos = iSize-pos; - iPos = pos; - rNext.setPos( iStart+pos ); + if( iSize-pos < 0 ) + pos = 0; + else if( iSize-pos > iSize ) + pos = iSize; + else + pos = iSize-pos; + iPos = pos; + rNext.setPos( iStart+pos ); } bool Bu::SubStream::isEos() { - return rNext.isEos() || iPos == iSize; + return rNext.isEos() || iPos == iSize; } bool Bu::SubStream::canRead() { - return rNext.canRead() && (iPos < iSize); + return rNext.canRead() && (iPos < iSize); } bool Bu::SubStream::canWrite() { - return rNext.canWrite() && (iPos < iSize); + return rNext.canWrite() && (iPos < iSize); } -- cgit v1.2.3