From da3e87fe3bdd4d7c6a7dcf38adc2e10e3702adac Mon Sep 17 00:00:00 2001 From: kayomn Date: Thu, 23 Feb 2023 00:14:24 +0000 Subject: [PATCH] Tidy up coral::fixed_buffer interface --- source/coral/io.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/source/coral/io.cpp b/source/coral/io.cpp index 8a357e6..abbee10 100644 --- a/source/coral/io.cpp +++ b/source/coral/io.cpp @@ -20,13 +20,6 @@ export namespace coral { return {0, this->filled}; } - /** - * Returns the base pointer of the buffer data. - */ - u8 * begin() { - return this->data; - } - /** * Returns the base pointer of the buffer data. */ @@ -34,13 +27,6 @@ export namespace coral { return this->data; } - /** - * Returns the tail pointer of the buffer data. - */ - u8 * end() { - return this->data + this->cursor; - } - /** * Returns the tail pointer of the buffer data. */ @@ -49,7 +35,14 @@ export namespace coral { } /** - * Returns `true` if the buffer has been completely filled with data. + * Returns `true` if the buffer is completely empty of data, otherwise `false`. + */ + bool is_empty() const { + return this->filled == capacity; + } + + /** + * Returns `true` if the buffer has been completely filled with data, otherwise `false`. */ bool is_full() const { return this->filled == capacity;