diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
| commit | ec05778d5718a7912e506764d443a78d6a6179e3 (patch) | |
| tree | 78a9a01532180030c095acefc45763f07c14edb8 /src/stable/queuebuf.h | |
| parent | b20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff) | |
| download | libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2 libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip | |
Converted tabs to spaces with tabconv.
Diffstat (limited to '')
| -rw-r--r-- | src/stable/queuebuf.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/stable/queuebuf.h b/src/stable/queuebuf.h index 6e2a075..60aa115 100644 --- a/src/stable/queuebuf.h +++ b/src/stable/queuebuf.h | |||
| @@ -12,55 +12,55 @@ | |||
| 12 | 12 | ||
| 13 | namespace Bu | 13 | namespace Bu |
| 14 | { | 14 | { |
| 15 | /** | 15 | /** |
| 16 | * A queuing buffer stream class. All data written to this class is | 16 | * A queuing buffer stream class. All data written to this class is |
| 17 | * appended to it, there is no stored position. All data read is read | 17 | * appended to it, there is no stored position. All data read is read |
| 18 | * from the begining and then thrown away. It operates by using a linked | 18 | * from the begining and then thrown away. It operates by using a linked |
| 19 | * list of small buffers, and deallocating or reusing them when it can. | 19 | * list of small buffers, and deallocating or reusing them when it can. |
| 20 | */ | 20 | */ |
| 21 | class QueueBuf : public Bu::Stream | 21 | class QueueBuf : public Bu::Stream |
| 22 | { | 22 | { |
| 23 | public: | 23 | public: |
| 24 | QueueBuf( int iBlockSize=256 ); | 24 | QueueBuf( int iBlockSize=256 ); |
| 25 | virtual ~QueueBuf(); | 25 | virtual ~QueueBuf(); |
| 26 | 26 | ||
| 27 | virtual void close(); | 27 | virtual void close(); |
| 28 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); | 28 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
| 29 | virtual Bu::size peek( void *pBuf, Bu::size nBytes ); | 29 | virtual Bu::size peek( void *pBuf, Bu::size nBytes ); |
| 30 | virtual Bu::size peek( void *pBuf, Bu::size nBytes, Bu::size nSkip ); | 30 | virtual Bu::size peek( void *pBuf, Bu::size nBytes, Bu::size nSkip ); |
| 31 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); | 31 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
| 32 | virtual Bu::size tell(); | 32 | virtual Bu::size tell(); |
| 33 | virtual void seek( Bu::size offset ); | 33 | virtual void seek( Bu::size offset ); |
| 34 | virtual void setPos( Bu::size pos ); | 34 | virtual void setPos( Bu::size pos ); |
| 35 | virtual void setPosEnd( Bu::size pos ); | 35 | virtual void setPosEnd( Bu::size pos ); |
| 36 | virtual bool isEos(); | 36 | virtual bool isEos(); |
| 37 | virtual bool isOpen(); | 37 | virtual bool isOpen(); |
| 38 | virtual void flush(); | 38 | virtual void flush(); |
| 39 | virtual bool canRead(); | 39 | virtual bool canRead(); |
| 40 | virtual bool canWrite(); | 40 | virtual bool canWrite(); |
| 41 | virtual bool isReadable(); | 41 | virtual bool isReadable(); |
| 42 | virtual bool isWritable(); | 42 | virtual bool isWritable(); |
| 43 | virtual bool isSeekable(); | 43 | virtual bool isSeekable(); |
| 44 | virtual bool isBlocking(); | 44 | virtual bool isBlocking(); |
| 45 | virtual void setBlocking( bool bBlocking=true ); | 45 | virtual void setBlocking( bool bBlocking=true ); |
| 46 | virtual void setSize( Bu::size iSize ); | 46 | virtual void setSize( Bu::size iSize ); |
| 47 | 47 | ||
| 48 | virtual size getSize() const; | 48 | virtual size getSize() const; |
| 49 | virtual size getBlockSize() const; | 49 | virtual size getBlockSize() const; |
| 50 | virtual Bu::String getLocation() const; | 50 | virtual Bu::String getLocation() const; |
| 51 | 51 | ||
| 52 | private: | 52 | private: |
| 53 | void addBlock(); | 53 | void addBlock(); |
| 54 | void removeBlock(); | 54 | void removeBlock(); |
| 55 | 55 | ||
| 56 | private: | 56 | private: |
| 57 | int iBlockSize; | 57 | int iBlockSize; |
| 58 | int iReadOffset; | 58 | int iReadOffset; |
| 59 | int iWriteOffset; | 59 | int iWriteOffset; |
| 60 | Bu::size iTotalSize; | 60 | Bu::size iTotalSize; |
| 61 | typedef Bu::List<char *> BlockList; | 61 | typedef Bu::List<char *> BlockList; |
| 62 | BlockList lBlocks; | 62 | BlockList lBlocks; |
| 63 | }; | 63 | }; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | #endif | 66 | #endif |
