Browse Source

AK: Expose the seekback limit of CircularBuffer

Tim Schumacher 2 years ago
parent
commit
52d9fc92f1
2 changed files with 6 additions and 0 deletions
  1. 5 0
      AK/CircularBuffer.cpp
  2. 1 0
      AK/CircularBuffer.h

+ 5 - 0
AK/CircularBuffer.cpp

@@ -47,6 +47,11 @@ size_t CircularBuffer::capacity() const
     return m_buffer.size();
 }
 
+size_t CircularBuffer::seekback_limit() const
+{
+    return m_seekback_limit;
+}
+
 bool CircularBuffer::is_wrapping_around() const
 {
     return capacity() <= m_reading_head + m_used_space;

+ 1 - 0
AK/CircularBuffer.h

@@ -35,6 +35,7 @@ public:
     [[nodiscard]] size_t empty_space() const;
     [[nodiscard]] size_t used_space() const;
     [[nodiscard]] size_t capacity() const;
+    [[nodiscard]] size_t seekback_limit() const;
 
     Optional<size_t> offset_of(StringView needle, Optional<size_t> from = {}, Optional<size_t> until = {}) const;