From f1b9bf7a808edc5562b1d9c307472434c14bde5c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 3 Jan 2016 14:33:47 +0100 Subject: simple_compressor: Provide some accessors for end and free This makes code easier to read, and somewhat more correct. Gbp-Dch: ignore --- apt-pkg/contrib/fileutl.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 54af25369..e50cc694a 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -934,8 +934,11 @@ struct APT_HIDDEN simple_buffer { /*{{{*/ const char *get() const { return buffer + bufferstart; } char *get() { return buffer + bufferstart; } + const char *getend() const { return buffer + bufferend; } + char *getend() { return buffer + bufferend; } bool empty() const { return bufferend <= bufferstart; } bool full() const { return bufferend == buffersize_max; } + unsigned long long free() const { return buffersize_max - bufferend; } unsigned long long size() const { return bufferend-bufferstart; } void reset(size_t size) { -- cgit v1.2.3