From 2f884f92a19da436925f57859b64aab732ec4279 Mon Sep 17 00:00:00 2001 From: kayomn Date: Thu, 23 Feb 2023 00:18:14 +0000 Subject: [PATCH] Add way to count coral::fixed_buffer --- source/coral/io.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/coral/io.cpp b/source/coral/io.cpp index abbee10..c2b595e 100644 --- a/source/coral/io.cpp +++ b/source/coral/io.cpp @@ -27,6 +27,13 @@ export namespace coral { return this->data; } + /** + * Returns the number of bytes in the buffer that have been filled with data. + */ + usize count() const { + return this->filled; + } + /** * Returns the tail pointer of the buffer data. */