From: Julian Andres Klode Date: Sun, 3 Jan 2016 13:33:47 +0000 (+0100) Subject: simple_compressor: Provide some accessors for end and free X-Git-Tag: 1.2_exp1~47 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/f1b9bf7a808edc5562b1d9c307472434c14bde5c?ds=sidebyside simple_compressor: Provide some accessors for end and free This makes code easier to read, and somewhat more correct. Gbp-Dch: ignore --- 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) {