summaryrefslogtreecommitdiff
path: root/src/ro_buffer.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-02-20 22:54:56 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-02-20 22:54:56 +0100
commitb4d6df902253637f24647d3db2bc3781d69eec1c (patch)
treed8bf9ac04a270fabdfee1c15628c702471ef8bf5 /src/ro_buffer.hh
parent441cafc7124f633e5abc684e85a11ce3c991f6ae (diff)
Initial commitHEADmain
Diffstat (limited to 'src/ro_buffer.hh')
-rw-r--r--src/ro_buffer.hh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ro_buffer.hh b/src/ro_buffer.hh
new file mode 100644
index 0000000..93b2b3c
--- /dev/null
+++ b/src/ro_buffer.hh
@@ -0,0 +1,23 @@
+#ifndef RO_BUFFER_HH
+#define RO_BUFFER_HH
+
+#include <cstddef>
+
+class RoBuffer {
+public:
+ virtual ~RoBuffer() = default;
+
+ virtual bool empty() const = 0;
+
+ virtual char const* rbuf(size_t want, size_t& avail) = 0;
+ virtual void rcommit(size_t bytes) = 0;
+
+ size_t read(void* data, size_t len);
+
+protected:
+ RoBuffer() = default;
+ RoBuffer(RoBuffer const&) = delete;
+ RoBuffer& operator=(RoBuffer const&) = delete;
+};
+
+#endif // RO_BUFFER_HH