aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/Buffer.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-05-12 00:19:16 +0800
committercrupest <crupest@outlook.com>2024-05-17 23:55:37 +0800
commitb05c7d76dcfef6d882bc01fea4663a4c2fcdcdf2 (patch)
tree7a52140660b2c9d177513c3dadb4a689a5c45b07 /include/cru/common/Buffer.h
parentd861d799d2f614a6b58a8f0c0bc6a8911ad0dcfd (diff)
downloadcru-b05c7d76dcfef6d882bc01fea4663a4c2fcdcdf2.tar.gz
cru-b05c7d76dcfef6d882bc01fea4663a4c2fcdcdf2.tar.bz2
cru-b05c7d76dcfef6d882bc01fea4663a4c2fcdcdf2.zip
feat: completed BufferStream.
NEED TEST: BufferStream.
Diffstat (limited to 'include/cru/common/Buffer.h')
-rw-r--r--include/cru/common/Buffer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/cru/common/Buffer.h b/include/cru/common/Buffer.h
index 69c47aff..5c1f7ba3 100644
--- a/include/cru/common/Buffer.h
+++ b/include/cru/common/Buffer.h
@@ -23,6 +23,9 @@ class Buffer final {
bool IsNull() const { return ptr_ == nullptr; }
bool IsUsedReachEnd() const { return used_end_ == size_; }
+ Index GetFrontFree() const { return used_begin_; }
+ Index GetBackFree() const { return size_ - used_end_; }
+
Index GetUsedBegin() const { return used_begin_; }
Index GetUsedEnd() const { return used_end_; }