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/client.cpp | 57 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index c8d5dd4..02e51de 100644 --- a/src/client.cpp +++ b/src/client.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. @@ -40,7 +40,7 @@ Bu::Client::~Client() void Bu::Client::processInput() { char buf[RBS]; - size_t nRead, nTotal=0; + Bu::size nRead, nTotal=0; for(;;) { @@ -126,72 +126,72 @@ bool Bu::Client::isOpen() return pTopStream->isOpen(); } -size_t Bu::Client::write( const Bu::String &sData ) +Bu::size Bu::Client::write( const Bu::String &sData ) { return qbWrite.write( sData.getStr(), sData.getSize() ); } -size_t Bu::Client::write( const void *pData, size_t nBytes ) +Bu::size Bu::Client::write( const void *pData, Bu::size nBytes ) { return qbWrite.write( pData, nBytes ); } -size_t Bu::Client::write( int8_t nData ) +Bu::size Bu::Client::write( int8_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( int16_t nData ) +Bu::size Bu::Client::write( int16_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( int32_t nData ) +Bu::size Bu::Client::write( int32_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( int64_t nData ) +Bu::size Bu::Client::write( int64_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( uint8_t nData ) +Bu::size Bu::Client::write( uint8_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( uint16_t nData ) +Bu::size Bu::Client::write( uint16_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( uint32_t nData ) +Bu::size Bu::Client::write( uint32_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::write( uint64_t nData ) +Bu::size Bu::Client::write( uint64_t nData ) { return qbWrite.write( (const char *)&nData, sizeof(nData) ); } -size_t Bu::Client::read( void *pData, size_t nBytes ) +Bu::size Bu::Client::read( void *pData, Bu::size nBytes ) { return qbRead.read( pData, nBytes ); } -size_t Bu::Client::peek( void *pData, int nBytes, int nOffset ) +Bu::size Bu::Client::peek( void *pData, int nBytes, int nOffset ) { return qbRead.peek( pData, nBytes, nOffset ); } -long Bu::Client::getInputSize() +Bu::size Bu::Client::getInputSize() { return qbRead.getSize(); } -long Bu::Client::getOutputSize() +Bu::size Bu::Client::getOutputSize() { return qbWrite.getSize(); } @@ -233,22 +233,22 @@ void Bu::Client::tick() pProto->onTick( this ); } -long Bu::Client::tell() +Bu::size Bu::Client::tell() { return 0; } -void Bu::Client::seek( long offset ) +void Bu::Client::seek( Bu::size offset ) { return qbRead.seek( offset ); } -void Bu::Client::setPos( long ) +void Bu::Client::setPos( Bu::size ) { throw Bu::ExceptionBase(); } -void Bu::Client::setPosEnd( long ) +void Bu::Client::setPosEnd( Bu::size ) { throw Bu::ExceptionBase(); } @@ -298,8 +298,23 @@ void Bu::Client::setBlocking( bool ) throw Bu::ExceptionBase(); } -void Bu::Client::setSize( long ) +void Bu::Client::setSize( Bu::size ) { throw Bu::ExceptionBase(); } +Bu::size Bu::Client::getSize() const +{ + return 0; +} + +Bu::size Bu::Client::getBlockSize() const +{ + return pSocket->getBlockSize(); +} + +Bu::String Bu::Client::getLocation() const +{ + return pSocket->getLocation(); +} + -- cgit v1.2.3