diff options
author | Nicola Mettifogo | 2007-02-25 22:17:41 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-02-25 22:17:41 +0000 |
commit | c9f652dc1fb40f87d35a3700163b5e36dc6df0dd (patch) | |
tree | e6f00c2c18c90893da1f47ff47d202306d29c68b | |
parent | d74a33942410fbf6b38fc04cbb867baf659ca775 (diff) | |
download | scummvm-rg350-c9f652dc1fb40f87d35a3700163b5e36dc6df0dd.tar.gz scummvm-rg350-c9f652dc1fb40f87d35a3700163b5e36dc6df0dd.tar.bz2 scummvm-rg350-c9f652dc1fb40f87d35a3700163b5e36dc6df0dd.zip |
made Archive inherit from SeekableReadStream instead of File since write capabilities and file handle are not needed. Implementation of SeekableReadStream virtual functions is now complete.
svn-id: r25870
-rw-r--r-- | engines/parallaction/archive.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 5 |
2 files changed, 11 insertions, 7 deletions
diff --git a/engines/parallaction/archive.cpp b/engines/parallaction/archive.cpp index c8f5f4903f..a2a6aeaf32 100644 --- a/engines/parallaction/archive.cpp +++ b/engines/parallaction/archive.cpp @@ -114,6 +114,14 @@ uint32 Archive::size() const { return (_file == true ? _fileEndOffset - _fileOffset : 0); } +uint32 Archive::pos() const { + return (_file == true ? _fileCursor - _fileOffset : 0 ); +} + +bool Archive::eos() const { + return (_file == true ? _fileCursor == _fileEndOffset : true ); +} + void Archive::seek(int32 offs, int whence) { assert(_file == true && _fileCursor <= _fileEndOffset); @@ -151,10 +159,5 @@ uint32 Archive::read(void *dataPtr, uint32 dataSize) { } -uint32 Archive::write(const void *dataPtr, uint32 dataSize) { - error("Archive files don't support writing"); -} - - } // namespace Parallaction diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index aee57cb487..8bc66a5ebc 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -37,7 +37,7 @@ namespace Parallaction { #define DIRECTORY_OFFSET_IN_FILE 0x4000 -class Archive : public Common::File { +class Archive : public Common::SeekableReadStream { protected: @@ -65,10 +65,11 @@ public: void closeArchivedFile(); uint32 size() const; + uint32 pos() const; + bool eos() const; void seek(int32 offs, int whence = SEEK_SET); uint32 read(void *dataPtr, uint32 dataSize); - uint32 write(const void *dataPtr, uint32 dataSize); }; |