From 7c6c9538b03c9eae24e38fbeb30dd76a16aff1d2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 20 Jan 2011 05:30:43 +0000 Subject: Wow, got the Stream changes propegated, all tests build with string instead of fstring, and updated the copyright notice to extend to 2011 --- src/myriadstream.cpp | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'src/myriadstream.cpp') diff --git a/src/myriadstream.cpp b/src/myriadstream.cpp index 74dca04..a968a0c 100644 --- a/src/myriadstream.cpp +++ b/src/myriadstream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2010 Xagasoft, All rights reserved. + * Copyright (C) 2007-2011 Xagasoft, All rights reserved. * * This file is part of the libbu++ library and is released under the * terms of the license contained in the file LICENSE. @@ -46,13 +46,13 @@ void Bu::MyriadStream::close() { } -size_t Bu::MyriadStream::read( void *pBuf, size_t nBytes ) +Bu::size Bu::MyriadStream::read( void *pBuf, Bu::size nBytes ) { #ifdef MYRIAD_STREAM_DEBUG sio << "MyriadStream: read: " << __LINE__ << ": Started, asked to read " << nBytes << "b." << sio.nl; #endif - if( nBytes > (size_t)pStream->iSize-iPos ) + if( nBytes > (Bu::size)pStream->iSize-iPos ) nBytes = pStream->iSize-iPos; if( nBytes <= 0 ) return 0; @@ -109,7 +109,7 @@ size_t Bu::MyriadStream::read( void *pBuf, size_t nBytes ) return nBytes; } -size_t Bu::MyriadStream::write( const void *pBuf, size_t nBytes ) +Bu::size Bu::MyriadStream::write( const void *pBuf, Bu::size nBytes ) { if( nBytes <= 0 ) return 0; @@ -215,22 +215,22 @@ size_t Bu::MyriadStream::write( const void *pBuf, size_t nBytes ) return nBytes; } -long Bu::MyriadStream::tell() +Bu::size Bu::MyriadStream::tell() { return iPos; } -void Bu::MyriadStream::seek( long offset ) +void Bu::MyriadStream::seek( Bu::size offset ) { iPos += offset; } -void Bu::MyriadStream::setPos( long pos ) +void Bu::MyriadStream::setPos( Bu::size pos ) { iPos = pos; } -void Bu::MyriadStream::setPosEnd( long pos ) +void Bu::MyriadStream::setPosEnd( Bu::size pos ) { iPos = pStream->iSize-pos; } @@ -283,7 +283,7 @@ void Bu::MyriadStream::setBlocking( bool /*bBlocking*/ ) { } -void Bu::MyriadStream::setSize( long iSize ) +void Bu::MyriadStream::setSize( Bu::size iSize ) { if( iSize < 0 ) iSize = 0; @@ -292,3 +292,20 @@ void Bu::MyriadStream::setSize( long iSize ) iPos = iSize; } +Bu::size Bu::MyriadStream::getSize() const +{ + return pStream->iSize; +} + +Bu::size Bu::MyriadStream::getBlockSize() const +{ + return rMyriad.getBlockSize(); +} + +Bu::String Bu::MyriadStream::getLocation() const +{ + Bu::String s; + s.format("%d", pStream->iId ); + return s; +} + -- cgit v1.2.3