Browse Source

simple_compressor: Provide some accessors for end and free

This makes code easier to read, and somewhat more correct.

Gbp-Dch: ignore
tags/debian/1.2_exp1
Julian Andres Klode 6 years ago
parent
commit
f1b9bf7a80
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      apt-pkg/contrib/fileutl.cc

+ 3
- 0
apt-pkg/contrib/fileutl.cc View File

@@ -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)
{


Loading…
Cancel
Save