diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-26 19:22:02 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-26 19:22:02 +0000 |
commit | 01ecf54b07e75c17ca5f7039084daeefaea9a1c7 (patch) | |
tree | 9e3581a62e292ba86bfa80160dd4d1a85f3a5863 /src/membuf.h | |
parent | 20584158e3d7f6a012a677476ba36d1691c7aa66 (diff) | |
download | libbu++-01ecf54b07e75c17ca5f7039084daeefaea9a1c7.tar.gz libbu++-01ecf54b07e75c17ca5f7039084daeefaea9a1c7.tar.bz2 libbu++-01ecf54b07e75c17ca5f7039084daeefaea9a1c7.tar.xz libbu++-01ecf54b07e75c17ca5f7039084daeefaea9a1c7.zip |
Fixed a bug in the plugger and added the skeleton of the MemBuf class.
Diffstat (limited to '')
-rw-r--r-- | src/membuf.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/membuf.h b/src/membuf.h new file mode 100644 index 0000000..2cbbbdc --- /dev/null +++ b/src/membuf.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef MEM_BUF_H | ||
2 | #define MEM_BUF_H | ||
3 | |||
4 | #include <stdint.h> | ||
5 | |||
6 | #include "bu/stream.h" | ||
7 | |||
8 | namespace Bu | ||
9 | { | ||
10 | /** | ||
11 | * A memory buffer stream. | ||
12 | */ | ||
13 | class MemBuf : public Stream | ||
14 | { | ||
15 | public: | ||
16 | MemBuf(); | ||
17 | virtual ~MemBuf(); | ||
18 | |||
19 | virtual void close(); | ||
20 | virtual size_t read( void *pBuf, size_t nBytes ); | ||
21 | virtual size_t write( const void *pBuf, size_t nBytes ); | ||
22 | virtual long tell(); | ||
23 | virtual void seek( long offset ); | ||
24 | virtual void setPos( long pos ); | ||
25 | virtual void setPosEnd( long pos ); | ||
26 | virtual bool isEOS(); | ||
27 | virtual bool isOpen(); | ||
28 | virtual void flush(); | ||
29 | virtual bool canRead(); | ||
30 | virtual bool canWrite(); | ||
31 | virtual bool isReadable(); | ||
32 | virtual bool isWritable(); | ||
33 | virtual bool isSeekable(); | ||
34 | virtual bool isBlocking(); | ||
35 | virtual void setBlocking( bool bBlocking=true ); | ||
36 | |||
37 | private: | ||
38 | Bu::FString sBuf; | ||
39 | long nPos; | ||
40 | }; | ||
41 | } | ||
42 | |||
43 | #endif | ||