From 52bee8f81fe749c37030ee3095471d8c2f0d8ab4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 2 Aug 2019 22:49:50 +0200 Subject: [PATCH] util/StaticFifoBuffer: add GetAvailable() --- src/util/StaticFifoBuffer.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/StaticFifoBuffer.hxx b/src/util/StaticFifoBuffer.hxx index 3598d7246..615f92e3f 100644 --- a/src/util/StaticFifoBuffer.hxx +++ b/src/util/StaticFifoBuffer.hxx @@ -111,6 +111,10 @@ public: tail += n; } + constexpr size_type GetAvailable() const noexcept { + return tail - head; + } + /** * Return a buffer range which may be read. The buffer pointer is * writable, to allow modifications while parsing.