From 71167b3c8fb1ce47feb72b9376b899e40ffd3907 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 20 Feb 2015 17:53:33 +0100 Subject: wip --- ByteBuffer.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'ByteBuffer.h') diff --git a/ByteBuffer.h b/ByteBuffer.h index b3e06cf..3836966 100644 --- a/ByteBuffer.h +++ b/ByteBuffer.h @@ -17,14 +17,8 @@ public: class ByteBuffer { public: - /** - * Wrapping constructor, the size will be equal to the capacity. - */ ByteBuffer(const std::shared_ptr bytes, size_t capacity); - /** - * Wrapping constructor. - */ ByteBuffer(const std::shared_ptr bytes, size_t capacity, size_t zero, size_t size); inline size_t getSize() const { @@ -40,6 +34,10 @@ public: return ptr - zero; } + inline size_t getBytesLeft() const { + return end - ptr; + } + inline void setCursor(size_t newCursor) { // assertCanAccessRelative(newCursor); ptr = (uint8_t *) &zero[newCursor]; -- cgit v1.2.3