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 | |
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.
-rw-r--r-- | src/membuf.cpp | 81 | ||||
-rw-r--r-- | src/membuf.h | 43 | ||||
-rw-r--r-- | src/plugger.h | 2 |
3 files changed, 125 insertions, 1 deletions
diff --git a/src/membuf.cpp b/src/membuf.cpp new file mode 100644 index 0000000..fdb4366 --- /dev/null +++ b/src/membuf.cpp | |||
@@ -0,0 +1,81 @@ | |||
1 | #include "bu/membuf.h" | ||
2 | |||
3 | using namespace Bu; | ||
4 | |||
5 | Bu::MemBuf::MemBuf() | ||
6 | { | ||
7 | } | ||
8 | |||
9 | Bu::MemBuf::~MemBuf() | ||
10 | { | ||
11 | } | ||
12 | |||
13 | void Bu::MemBuf::close() | ||
14 | { | ||
15 | } | ||
16 | |||
17 | size_t Bu::MemBuf::read( void *pBuf, size_t nBytes ) | ||
18 | { | ||
19 | |||
20 | } | ||
21 | |||
22 | size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes ) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | long Bu::MemBuf::tell() | ||
27 | { | ||
28 | } | ||
29 | |||
30 | void Bu::MemBuf::seek( long offset ) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void Bu::MemBuf::setPos( long pos ) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | void Bu::MemBuf::setPosEnd( long pos ) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | bool Bu::MemBuf::isEOS() | ||
43 | { | ||
44 | } | ||
45 | |||
46 | bool Bu::MemBuf::isOpen() | ||
47 | { | ||
48 | } | ||
49 | |||
50 | void Bu::MemBuf::flush() | ||
51 | { | ||
52 | } | ||
53 | |||
54 | bool Bu::MemBuf::canRead() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | bool Bu::MemBuf::canWrite() | ||
59 | { | ||
60 | } | ||
61 | |||
62 | bool Bu::MemBuf::isReadable() | ||
63 | { | ||
64 | } | ||
65 | |||
66 | bool Bu::MemBuf::isWritable() | ||
67 | { | ||
68 | } | ||
69 | |||
70 | bool Bu::MemBuf::isSeekable() | ||
71 | { | ||
72 | } | ||
73 | |||
74 | bool Bu::MemBuf::isBlocking() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | void Bu::MemBuf::setBlocking( bool bBlocking ) | ||
79 | { | ||
80 | } | ||
81 | |||
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 | ||
diff --git a/src/plugger.h b/src/plugger.h index 98d4ecc..01bbb50 100644 --- a/src/plugger.h +++ b/src/plugger.h | |||
@@ -148,7 +148,7 @@ namespace Bu | |||
148 | return NULL; | 148 | return NULL; |
149 | 149 | ||
150 | T *p = (T *)pReg->pInfo->createPlugin(); | 150 | T *p = (T *)pReg->pInfo->createPlugin(); |
151 | hObj.insert( p, pReg ); | 151 | hObj.insert( (int )p, pReg ); |
152 | //printf("pReg: %08X, pPlug: %08X\n", pReg, p ); | 152 | //printf("pReg: %08X, pPlug: %08X\n", pReg, p ); |
153 | 153 | ||
154 | return p; | 154 | return p; |