From 01ecf54b07e75c17ca5f7039084daeefaea9a1c7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 26 Jun 2007 19:22:02 +0000 Subject: Fixed a bug in the plugger and added the skeleton of the MemBuf class. --- src/membuf.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/membuf.h | 43 +++++++++++++++++++++++++++++++ src/plugger.h | 2 +- 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 src/membuf.cpp create mode 100644 src/membuf.h 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 @@ +#include "bu/membuf.h" + +using namespace Bu; + +Bu::MemBuf::MemBuf() +{ +} + +Bu::MemBuf::~MemBuf() +{ +} + +void Bu::MemBuf::close() +{ +} + +size_t Bu::MemBuf::read( void *pBuf, size_t nBytes ) +{ + +} + +size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes ) +{ +} + +long Bu::MemBuf::tell() +{ +} + +void Bu::MemBuf::seek( long offset ) +{ +} + +void Bu::MemBuf::setPos( long pos ) +{ +} + +void Bu::MemBuf::setPosEnd( long pos ) +{ +} + +bool Bu::MemBuf::isEOS() +{ +} + +bool Bu::MemBuf::isOpen() +{ +} + +void Bu::MemBuf::flush() +{ +} + +bool Bu::MemBuf::canRead() +{ +} + +bool Bu::MemBuf::canWrite() +{ +} + +bool Bu::MemBuf::isReadable() +{ +} + +bool Bu::MemBuf::isWritable() +{ +} + +bool Bu::MemBuf::isSeekable() +{ +} + +bool Bu::MemBuf::isBlocking() +{ +} + +void Bu::MemBuf::setBlocking( bool bBlocking ) +{ +} + 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 @@ +#ifndef MEM_BUF_H +#define MEM_BUF_H + +#include + +#include "bu/stream.h" + +namespace Bu +{ + /** + * A memory buffer stream. + */ + class MemBuf : public Stream + { + public: + MemBuf(); + virtual ~MemBuf(); + + virtual void close(); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual size_t write( const void *pBuf, size_t nBytes ); + virtual long tell(); + virtual void seek( long offset ); + virtual void setPos( long pos ); + virtual void setPosEnd( long pos ); + virtual bool isEOS(); + virtual bool isOpen(); + virtual void flush(); + virtual bool canRead(); + virtual bool canWrite(); + virtual bool isReadable(); + virtual bool isWritable(); + virtual bool isSeekable(); + virtual bool isBlocking(); + virtual void setBlocking( bool bBlocking=true ); + + private: + Bu::FString sBuf; + long nPos; + }; +} + +#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 return NULL; T *p = (T *)pReg->pInfo->createPlugin(); - hObj.insert( p, pReg ); + hObj.insert( (int )p, pReg ); //printf("pReg: %08X, pPlug: %08X\n", pReg, p ); return p; -- cgit v1.2.3