From 76ea96f91115585f7c6b49d11ba60ec15bee12e6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 28 Jun 2007 22:53:10 +0000 Subject: Updated the client, it now takes all intXX_t and uintXX_t as a param for write as a convinience. --- src/client.cpp | 20 ++++++++++++++++++++ src/client.h | 4 ++++ 2 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 63822ba..2f293b7 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -124,6 +124,26 @@ void Bu::Client::write( int64_t nData ) sWriteBuf.append( (const char *)&nData, sizeof(nData) ); } +void Bu::Client::write( uint8_t nData ) +{ + sWriteBuf.append( (const char *)&nData, sizeof(nData) ); +} + +void Bu::Client::write( uint16_t nData ) +{ + sWriteBuf.append( (const char *)&nData, sizeof(nData) ); +} + +void Bu::Client::write( uint32_t nData ) +{ + sWriteBuf.append( (const char *)&nData, sizeof(nData) ); +} + +void Bu::Client::write( uint64_t nData ) +{ + sWriteBuf.append( (const char *)&nData, sizeof(nData) ); +} + void Bu::Client::read( char *pData, int nBytes ) { memcpy( pData, sReadBuf.getStr()+nRBOffset, nBytes ); diff --git a/src/client.h b/src/client.h index b400bb3..1253dcd 100644 --- a/src/client.h +++ b/src/client.h @@ -29,6 +29,10 @@ namespace Bu void write( int16_t nData ); void write( int32_t nData ); void write( int64_t nData ); + void write( uint8_t nData ); + void write( uint16_t nData ); + void write( uint32_t nData ); + void write( uint64_t nData ); void read( char *pData, int nBytes ); long getInputSize(); -- cgit v1.2.3