COMMON: Changed DumpFile & StdIOStream to derive from SeekableWriteStream

This commit is contained in:
Paul Gilbert 2019-05-04 16:20:22 +10:00 committed by Filippos Karapetis
parent f4dacdf34d
commit b821e8fce4
3 changed files with 27 additions and 14 deletions

View file

@ -219,4 +219,14 @@ bool DumpFile::flush() {
int32 DumpFile::pos() const { return _handle->pos(); }
bool DumpFile::seek(int32 offset, int whence) {
SeekableWriteStream *ws = dynamic_cast<SeekableWriteStream *>(_handle);
return ws ? ws->seek(offset, whence) : -1;
}
int32 DumpFile::size() const {
SeekableWriteStream *ws = dynamic_cast<SeekableWriteStream *>(_handle);
return ws ? ws->size() : -1;
}
} // End of namespace Common