aboutsummaryrefslogtreecommitdiff
path: root/src/stable/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/stable/buffer.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/stable/buffer.h b/src/stable/buffer.h
index a8303fa..21a5812 100644
--- a/src/stable/buffer.h
+++ b/src/stable/buffer.h
@@ -12,47 +12,47 @@
12 12
13namespace Bu 13namespace Bu
14{ 14{
15 class Buffer : public Bu::Filter 15 class Buffer : public Bu::Filter
16 { 16 {
17 public: 17 public:
18 Buffer( Bu::Stream &rNext, int iWhat=Both, int iBufSize=4096 ); 18 Buffer( Bu::Stream &rNext, int iWhat=Both, int iBufSize=4096 );
19 virtual ~Buffer(); 19 virtual ~Buffer();
20 20
21 enum 21 enum
22 { 22 {
23 Write = 1, 23 Write = 1,
24 Read = 2, 24 Read = 2,
25 Both = 3 25 Both = 3
26 }; 26 };
27 27
28 virtual void start(); 28 virtual void start();
29 virtual Bu::size stop(); 29 virtual Bu::size stop();
30 30
31 virtual Bu::size read( void *pBuf, Bu::size nBytes ); 31 virtual Bu::size read( void *pBuf, Bu::size nBytes );
32 virtual Bu::size write( const void *pBuf, Bu::size nBytes ); 32 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
33 using Stream::write; 33 using Stream::write;
34 34
35 Bu::size getReadFill() { return iReadBufFill; } 35 Bu::size getReadFill() { return iReadBufFill; }
36 bool isWritePending() { return iWriteBufFill > 0; } 36 bool isWritePending() { return iWriteBufFill > 0; }
37 37
38 virtual void flush(); 38 virtual void flush();
39 39
40 virtual bool isEos(); 40 virtual bool isEos();
41 41
42 private: 42 private:
43 void fillReadBuf(); 43 void fillReadBuf();
44 44
45 private: 45 private:
46 Bu::size sSoFar; 46 Bu::size sSoFar;
47 int iBufSize; 47 int iBufSize;
48 char *sReadBuf; 48 char *sReadBuf;
49 char *sWriteBuf; 49 char *sWriteBuf;
50 int iReadBufFill; 50 int iReadBufFill;
51 int iReadPos; 51 int iReadPos;
52 int iWriteBufFill; 52 int iWriteBufFill;
53 int iWritePos; 53 int iWritePos;
54 int iWhat; 54 int iWhat;
55 }; 55 };
56}; 56};
57 57
58#endif 58#endif