aboutsummaryrefslogtreecommitdiff
path: root/lib/base/buffer.h
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2003-10-17 15:36:42 +0000
committerFelix Domke <tmbinc@elitedvb.net>2003-10-17 15:36:42 +0000
commitd63d2c3c6cbbd574dda4f8b00ebe6c661735edd5 (patch)
tree84d0cacfd0b6c1241c236c7860f7cbd7f26901bb /lib/base/buffer.h
downloadenigma2-d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5.tar.gz
enigma2-d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5.zip
import of enigma2
Diffstat (limited to 'lib/base/buffer.h')
-rw-r--r--lib/base/buffer.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/base/buffer.h b/lib/base/buffer.h
new file mode 100644
index 00000000..9108ba8b
--- /dev/null
+++ b/lib/base/buffer.h
@@ -0,0 +1,40 @@
+#ifndef __src_lib_base_buffer_h
+#define __src_lib_base_buffer_h
+
+#include <asm/types.h>
+#include <list>
+
+/**
+ * IO buffer.
+ */
+class eIOBuffer
+{
+ int allocationsize;
+ struct eIOBufferData
+ {
+ __u8 *data;
+ int len;
+ };
+ std::list<eIOBufferData> buffer;
+ void removeblock();
+ eIOBufferData &addblock();
+ int ptr;
+public:
+ eIOBuffer(int allocationsize): allocationsize(allocationsize), ptr(0)
+ {
+ }
+ ~eIOBuffer();
+ int size() const;
+ int empty() const;
+ void clear();
+ int peek(void *dest, int len) const;
+ void skip(int len);
+ int read(void *dest, int len);
+ void write(const void *source, int len);
+ int fromfile(int fd, int len);
+ int tofile(int fd, int len);
+
+ int searchchr(char ch) const;
+};
+
+#endif