summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/membuf.cpp81
-rw-r--r--src/membuf.h43
-rw-r--r--src/plugger.h2
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
3using namespace Bu;
4
5Bu::MemBuf::MemBuf()
6{
7}
8
9Bu::MemBuf::~MemBuf()
10{
11}
12
13void Bu::MemBuf::close()
14{
15}
16
17size_t Bu::MemBuf::read( void *pBuf, size_t nBytes )
18{
19
20}
21
22size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes )
23{
24}
25
26long Bu::MemBuf::tell()
27{
28}
29
30void Bu::MemBuf::seek( long offset )
31{
32}
33
34void Bu::MemBuf::setPos( long pos )
35{
36}
37
38void Bu::MemBuf::setPosEnd( long pos )
39{
40}
41
42bool Bu::MemBuf::isEOS()
43{
44}
45
46bool Bu::MemBuf::isOpen()
47{
48}
49
50void Bu::MemBuf::flush()
51{
52}
53
54bool Bu::MemBuf::canRead()
55{
56}
57
58bool Bu::MemBuf::canWrite()
59{
60}
61
62bool Bu::MemBuf::isReadable()
63{
64}
65
66bool Bu::MemBuf::isWritable()
67{
68}
69
70bool Bu::MemBuf::isSeekable()
71{
72}
73
74bool Bu::MemBuf::isBlocking()
75{
76}
77
78void 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
8namespace 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;