22 #ifndef COMMON_SUBSTREAM_H 23 #define COMMON_SUBSTREAM_H 25 #include "common/mutex.h" 26 #include "common/ptr.h" 27 #include "common/stream.h" 28 #include "common/types.h" 56 SubReadStream(
ReadStream *parentStream, uint32 end, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO)
57 : _parentStream(parentStream, disposeParentStream),
64 virtual bool eos()
const {
return _eos || _parentStream->eos(); }
65 virtual bool err()
const {
return _parentStream->err(); }
66 virtual void clearErr() { _eos =
false; _parentStream->clearErr(); }
67 virtual uint32
read(
void *dataPtr, uint32 dataSize);
85 virtual int64
pos()
const {
return _pos - _begin; }
86 virtual int64
size()
const {
return _end - _begin; }
88 virtual bool seek(int64 offset,
int whence = SEEK_SET);
110 virtual uint32
read(
void *dataPtr, uint32 dataSize);
126 uint32
read(
void *dataPtr, uint32 dataSize)
override;
Definition: substream.h:120
Definition: substream.h:104
virtual int64 pos() const
Definition: substream.h:85
virtual bool eos() const
Definition: substream.h:64
Definition: substream.h:78
Definition: algorithm.h:29
virtual int64 size() const
Definition: substream.h:86
virtual uint32 read(void *dataPtr, uint32 dataSize)
Definition: substream.h:49
virtual void clearErr()
Definition: substream.h:66
virtual bool err() const
Definition: substream.h:65