From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/sbuffer.cpp | 67 --------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/sbuffer.cpp (limited to 'src/sbuffer.cpp') diff --git a/src/sbuffer.cpp b/src/sbuffer.cpp deleted file mode 100644 index f84f8a3..0000000 --- a/src/sbuffer.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include "sbuffer.h" - -SBuffer::SBuffer() : - nPos( 0 ), - bOpen( true ) -{ -} - -SBuffer::~SBuffer() -{ -} - -void SBuffer::close() -{ - bOpen = false; - fbData.clearData(); -} - -size_t SBuffer::read( char *pBuf, size_t nBytes ) -{ - size_t nLeft = fbData.getLength() - nPos; - if( nBytes > nLeft ) - nBytes = nLeft; - - if( nLeft == 0 ) - return 0; - - memcpy( pBuf, fbData.getData()+nPos, nBytes ); - nPos += nBytes; - - return nBytes; -} - -size_t SBuffer::write( const char *pBuf, size_t nBytes ) -{ - fbData.appendData( pBuf, nBytes ); - nPos += nBytes; - - return nBytes; -} - -long SBuffer::tell() -{ - return nPos; -} - -void SBuffer::seek( long offset ) -{ - nPos += offset; -} - -void SBuffer::setPos( long pos ) -{ - nPos = pos; -} - -void SBuffer::setPosEnd( long pos ) -{ - nPos = fbData.getLength() - pos; -} - -bool SBuffer::isEOS() -{ - return nPos == fbData.getLength(); -} - -- cgit v1.2.3