aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-08-21 04:39:47 +0000
committerMike Buland <eichlan@xagasoft.com>2010-08-21 04:39:47 +0000
commit7f17eeb7fccd52b7049f9f598121130dfd1b55ae (patch)
tree8afca1e4459f0bc719941514009f046cd77f88ed /src/client.cpp
parenta83e9babede7ab5bc8e1ac6c7ee3784b91bd8452 (diff)
downloadlibbu++-7f17eeb7fccd52b7049f9f598121130dfd1b55ae.tar.gz
libbu++-7f17eeb7fccd52b7049f9f598121130dfd1b55ae.tar.bz2
libbu++-7f17eeb7fccd52b7049f9f598121130dfd1b55ae.tar.xz
libbu++-7f17eeb7fccd52b7049f9f598121130dfd1b55ae.zip
Client now inherits from stream. This could be cool, it could really mess\nthings up. We shall see. In other news, I'm adding a Bu::StreamStack class\nthat will let you easily manage dynamic stream/filter sets.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp107
1 files changed, 85 insertions, 22 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 095dd91..789cda4 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -125,62 +125,62 @@ bool Bu::Client::isOpen()
125 return pTopStream->isOpen(); 125 return pTopStream->isOpen();
126} 126}
127 127
128void Bu::Client::write( const Bu::FString &sData ) 128size_t Bu::Client::write( const Bu::FString &sData )
129{ 129{
130 qbWrite.write( sData.getStr(), sData.getSize() ); 130 return qbWrite.write( sData.getStr(), sData.getSize() );
131} 131}
132 132
133void Bu::Client::write( const void *pData, int nBytes ) 133size_t Bu::Client::write( const void *pData, size_t nBytes )
134{ 134{
135 qbWrite.write( pData, nBytes ); 135 return qbWrite.write( pData, nBytes );
136} 136}
137 137
138void Bu::Client::write( int8_t nData ) 138size_t Bu::Client::write( int8_t nData )
139{ 139{
140 qbWrite.write( (const char *)&nData, sizeof(nData) ); 140 return qbWrite.write( (const char *)&nData, sizeof(nData) );
141} 141}
142 142
143void Bu::Client::write( int16_t nData ) 143size_t Bu::Client::write( int16_t nData )
144{ 144{
145 qbWrite.write( (const char *)&nData, sizeof(nData) ); 145 return qbWrite.write( (const char *)&nData, sizeof(nData) );
146} 146}
147 147
148void Bu::Client::write( int32_t nData ) 148size_t Bu::Client::write( int32_t nData )
149{ 149{
150 qbWrite.write( (const char *)&nData, sizeof(nData) ); 150 return qbWrite.write( (const char *)&nData, sizeof(nData) );
151} 151}
152 152
153void Bu::Client::write( int64_t nData ) 153size_t Bu::Client::write( int64_t nData )
154{ 154{
155 qbWrite.write( (const char *)&nData, sizeof(nData) ); 155 return qbWrite.write( (const char *)&nData, sizeof(nData) );
156} 156}
157 157
158void Bu::Client::write( uint8_t nData ) 158size_t Bu::Client::write( uint8_t nData )
159{ 159{
160 qbWrite.write( (const char *)&nData, sizeof(nData) ); 160 return qbWrite.write( (const char *)&nData, sizeof(nData) );
161} 161}
162 162
163void Bu::Client::write( uint16_t nData ) 163size_t Bu::Client::write( uint16_t nData )
164{ 164{
165 qbWrite.write( (const char *)&nData, sizeof(nData) ); 165 return qbWrite.write( (const char *)&nData, sizeof(nData) );
166} 166}
167 167
168void Bu::Client::write( uint32_t nData ) 168size_t Bu::Client::write( uint32_t nData )
169{ 169{
170 qbWrite.write( (const char *)&nData, sizeof(nData) ); 170 return qbWrite.write( (const char *)&nData, sizeof(nData) );
171} 171}
172 172
173void Bu::Client::write( uint64_t nData ) 173size_t Bu::Client::write( uint64_t nData )
174{ 174{
175 qbWrite.write( (const char *)&nData, sizeof(nData) ); 175 return qbWrite.write( (const char *)&nData, sizeof(nData) );
176} 176}
177 177
178int Bu::Client::read( void *pData, int nBytes ) 178size_t Bu::Client::read( void *pData, size_t nBytes )
179{ 179{
180 return qbRead.read( pData, nBytes ); 180 return qbRead.read( pData, nBytes );
181} 181}
182 182
183int Bu::Client::peek( void *pData, int nBytes, int nOffset ) 183size_t Bu::Client::peek( void *pData, int nBytes, int nOffset )
184{ 184{
185 return qbRead.peek( pData, nBytes, nOffset ); 185 return qbRead.peek( pData, nBytes, nOffset );
186} 186}
@@ -237,3 +237,66 @@ void Bu::Client::tick()
237 pProto->onTick( this ); 237 pProto->onTick( this );
238} 238}
239 239
240long Bu::Client::tell()
241{
242}
243
244void Bu::Client::seek( long offset )
245{
246}
247
248void Bu::Client::setPos( long pos )
249{
250}
251
252void Bu::Client::setPosEnd( long pos )
253{
254}
255
256bool Bu::Client::isEos()
257{
258 return true;
259}
260
261void Bu::Client::flush()
262{
263}
264
265bool Bu::Client::canRead()
266{
267 return qbRead.getSize() > 0;
268}
269
270bool Bu::Client::canWrite()
271{
272 return true;
273}
274
275bool Bu::Client::isReadable()
276{
277 return true;
278}
279
280bool Bu::Client::isWritable()
281{
282 return true;
283}
284
285bool Bu::Client::isSeekable()
286{
287 return false;
288}
289
290bool Bu::Client::isBlocking()
291{
292 return false;
293}
294
295void Bu::Client::setBlocking( bool bBlocking )
296{
297}
298
299void Bu::Client::setSize( long iSize )
300{
301}
302