InputStream: "protect" attributes
This commit is contained in:
@@ -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
|
||||
*/
|
||||
@@ -217,6 +217,13 @@ public:
|
||||
mime = _mime;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
bool KnownSize() const {
|
||||
assert(ready);
|
||||
|
||||
return size >= 0;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
offset_type GetSize() const {
|
||||
assert(ready);
|
||||
@@ -239,6 +246,15 @@ public:
|
||||
return offset;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
offset_type GetRest() const {
|
||||
assert(ready);
|
||||
assert(size >= 0);
|
||||
assert(offset >= 0);
|
||||
|
||||
return size - offset;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
bool IsSeekable() const {
|
||||
assert(ready);
|
||||
|
Reference in New Issue
Block a user