summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-01-03 14:33:47 +0100
committerJulian Andres Klode <jak@debian.org>2016-01-03 14:33:47 +0100
commitf1b9bf7a808edc5562b1d9c307472434c14bde5c (patch)
tree0b445de7df35ea792314eb77406306325a3834b2 /apt-pkg
parent5bdba2ca232b1f49165fbfcff8341b0887076a34 (diff)
simple_compressor: Provide some accessors for end and free
This makes code easier to read, and somewhat more correct. Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc3
1 files changed, 3 insertions, 0 deletions
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)
{