diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-28 22:53:10 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-28 22:53:10 +0000 |
commit | 76ea96f91115585f7c6b49d11ba60ec15bee12e6 (patch) | |
tree | 992f8359558f87906db67e910db9604b3b47d0b7 /src | |
parent | f896b0e207e0b656109ef0e9f721f27ce53a836e (diff) | |
download | libbu++-76ea96f91115585f7c6b49d11ba60ec15bee12e6.tar.gz libbu++-76ea96f91115585f7c6b49d11ba60ec15bee12e6.tar.bz2 libbu++-76ea96f91115585f7c6b49d11ba60ec15bee12e6.tar.xz libbu++-76ea96f91115585f7c6b49d11ba60ec15bee12e6.zip |
Updated the client, it now takes all intXX_t and uintXX_t as a param for write
as a convinience.
Diffstat (limited to '')
-rw-r--r-- | src/client.cpp | 20 | ||||
-rw-r--r-- | src/client.h | 4 |
2 files changed, 24 insertions, 0 deletions
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 ) | |||
124 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); | 124 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); |
125 | } | 125 | } |
126 | 126 | ||
127 | void Bu::Client::write( uint8_t nData ) | ||
128 | { | ||
129 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); | ||
130 | } | ||
131 | |||
132 | void Bu::Client::write( uint16_t nData ) | ||
133 | { | ||
134 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); | ||
135 | } | ||
136 | |||
137 | void Bu::Client::write( uint32_t nData ) | ||
138 | { | ||
139 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); | ||
140 | } | ||
141 | |||
142 | void Bu::Client::write( uint64_t nData ) | ||
143 | { | ||
144 | sWriteBuf.append( (const char *)&nData, sizeof(nData) ); | ||
145 | } | ||
146 | |||
127 | void Bu::Client::read( char *pData, int nBytes ) | 147 | void Bu::Client::read( char *pData, int nBytes ) |
128 | { | 148 | { |
129 | memcpy( pData, sReadBuf.getStr()+nRBOffset, nBytes ); | 149 | 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 | |||
29 | void write( int16_t nData ); | 29 | void write( int16_t nData ); |
30 | void write( int32_t nData ); | 30 | void write( int32_t nData ); |
31 | void write( int64_t nData ); | 31 | void write( int64_t nData ); |
32 | void write( uint8_t nData ); | ||
33 | void write( uint16_t nData ); | ||
34 | void write( uint32_t nData ); | ||
35 | void write( uint64_t nData ); | ||
32 | void read( char *pData, int nBytes ); | 36 | void read( char *pData, int nBytes ); |
33 | long getInputSize(); | 37 | long getInputSize(); |
34 | 38 | ||