aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-28 22:53:10 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-28 22:53:10 +0000
commit76ea96f91115585f7c6b49d11ba60ec15bee12e6 (patch)
tree992f8359558f87906db67e910db9604b3b47d0b7 /src/client.cpp
parentf896b0e207e0b656109ef0e9f721f27ce53a836e (diff)
downloadlibbu++-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 'src/client.cpp')
-rw-r--r--src/client.cpp20
1 files changed, 20 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
127void Bu::Client::write( uint8_t nData )
128{
129 sWriteBuf.append( (const char *)&nData, sizeof(nData) );
130}
131
132void Bu::Client::write( uint16_t nData )
133{
134 sWriteBuf.append( (const char *)&nData, sizeof(nData) );
135}
136
137void Bu::Client::write( uint32_t nData )
138{
139 sWriteBuf.append( (const char *)&nData, sizeof(nData) );
140}
141
142void Bu::Client::write( uint64_t nData )
143{
144 sWriteBuf.append( (const char *)&nData, sizeof(nData) );
145}
146
127void Bu::Client::read( char *pData, int nBytes ) 147void Bu::Client::read( char *pData, int nBytes )
128{ 148{
129 memcpy( pData, sReadBuf.getStr()+nRBOffset, nBytes ); 149 memcpy( pData, sReadBuf.getStr()+nRBOffset, nBytes );