summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/Buffer.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/includes/Buffer.h b/includes/Buffer.h
new file mode 100644
index 0000000..99a57f0
--- /dev/null
+++ b/includes/Buffer.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <Handle.h>
+
+namespace Balau {
+
+class Buffer : public SeekableHandle {
+ public:
+ Buffer() throw (GeneralException) : m_buffer(NULL), m_bufSize(0), m_numBlocks(0) { }
+ virtual void close() throw (GeneralException);
+ virtual ssize_t read(void * buf, size_t count) throw (GeneralException);
+ virtual ssize_t write(const void * buf, size_t count) throw (GeneralException);
+ virtual bool isClosed();
+ virtual bool canRead();
+ virtual bool canWrite();
+ virtual const char * getName();
+ virtual off_t getSize();
+ void reset();
+ private:
+ uint8_t * m_buffer;
+ off_t m_bufSize, m_numBlocks;
+};
+
+};