summaryrefslogtreecommitdiff
path: root/src/client.h
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.h
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.h')
-rw-r--r--src/client.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/client.h b/src/client.h
index 5a933ca..105d48f 100644
--- a/src/client.h
+++ b/src/client.h
@@ -23,7 +23,7 @@ namespace Bu
23 /** 23 /**
24 *@ingroup Serving 24 *@ingroup Serving
25 */ 25 */
26 class Client 26 class Client : public Bu::Stream
27 { 27 {
28 public: 28 public:
29 Client( Bu::Socket *pSocket, Bu::ClientLinkFactory *pfLink ); 29 Client( Bu::Socket *pSocket, Bu::ClientLinkFactory *pfLink );
@@ -34,18 +34,18 @@ namespace Bu
34 34
35 //Bu::FString &getInput(); 35 //Bu::FString &getInput();
36 //Bu::FString &getOutput(); 36 //Bu::FString &getOutput();
37 void write( const Bu::FString &sData ); 37 size_t write( const Bu::FString &sData );
38 void write( const void *pData, int nBytes ); 38 size_t write( const void *pData, size_t nBytes );
39 void write( int8_t nData ); 39 size_t write( int8_t nData );
40 void write( int16_t nData ); 40 size_t write( int16_t nData );
41 void write( int32_t nData ); 41 size_t write( int32_t nData );
42 void write( int64_t nData ); 42 size_t write( int64_t nData );
43 void write( uint8_t nData ); 43 size_t write( uint8_t nData );
44 void write( uint16_t nData ); 44 size_t write( uint16_t nData );
45 void write( uint32_t nData ); 45 size_t write( uint32_t nData );
46 void write( uint64_t nData ); 46 size_t write( uint64_t nData );
47 int read( void *pData, int nBytes ); 47 size_t read( void *pData, size_t nBytes );
48 int peek( void *pData, int nBytes, int nOffset=0 ); 48 size_t peek( void *pData, int nBytes, int nOffset=0 );
49 void seek( int nBytes ); 49 void seek( int nBytes );
50 long getInputSize(); 50 long getInputSize();
51 long getOutputSize(); 51 long getOutputSize();
@@ -94,6 +94,25 @@ namespace Bu
94 lFilts.prepend( pFlt ); 94 lFilts.prepend( pFlt );
95 } 95 }
96 96
97 /*
98 * These are required to qualify as a stream, I dunno how many will
99 * be implemented.
100 */
101 virtual long tell();
102 virtual void seek( long offset );
103 virtual void setPos( long pos );
104 virtual void setPosEnd( long pos );
105 virtual bool isEos();
106 virtual void flush();
107 virtual bool canRead();
108 virtual bool canWrite();
109 virtual bool isReadable();
110 virtual bool isWritable();
111 virtual bool isSeekable();
112 virtual bool isBlocking();
113 virtual void setBlocking( bool bBlocking=true );
114 virtual void setSize( long iSize );
115
97 private: 116 private:
98 typedef Bu::List<Bu::Stream *> FilterList; 117 typedef Bu::List<Bu::Stream *> FilterList;
99 FilterList lFilts; 118 FilterList lFilts;