summaryrefslogtreecommitdiff
path: root/src/util/StaticFifoBuffer.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-08-02 22:49:50 +0200
committerMax Kellermann <max@musicpd.org>2019-08-02 22:49:55 +0200
commit52bee8f81fe749c37030ee3095471d8c2f0d8ab4 (patch)
tree217e2327e17e05ba6b81e00148b37b953cd55b13 /src/util/StaticFifoBuffer.hxx
parentadc25e648fe5237694d237fd781d4705bf01bbd4 (diff)
util/StaticFifoBuffer: add GetAvailable()
Diffstat (limited to 'src/util/StaticFifoBuffer.hxx')
-rw-r--r--src/util/StaticFifoBuffer.hxx4
1 files changed, 4 insertions, 0 deletions
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.