aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/InputStream.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/input/InputStream.hxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/input/InputStream.hxx b/src/input/InputStream.hxx
index 13f6af32b..5f754940b 100644
--- a/src/input/InputStream.hxx
+++ b/src/input/InputStream.hxx
@@ -64,6 +64,7 @@ public:
*/
Cond &cond;
+protected:
/**
* indicates whether the stream is ready for reading and
* whether the other attributes in this struct are valid
@@ -80,7 +81,6 @@ public:
*/
offset_type size;
-public:
/**
* the current offset within the stream
*/
@@ -218,6 +218,13 @@ public:
}
gcc_pure
+ bool KnownSize() const {
+ assert(ready);
+
+ return size >= 0;
+ }
+
+ gcc_pure
offset_type GetSize() const {
assert(ready);
@@ -240,6 +247,15 @@ public:
}
gcc_pure
+ offset_type GetRest() const {
+ assert(ready);
+ assert(size >= 0);
+ assert(offset >= 0);
+
+ return size - offset;
+ }
+
+ gcc_pure
bool IsSeekable() const {
assert(ready);