[Scummvm-cvs-logs] SF.net SVN: scummvm: [25870] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Feb 25 23:17:42 CET 2007


Revision: 25870
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25870&view=rev
Author:   peres001
Date:     2007-02-25 14:17:41 -0800 (Sun, 25 Feb 2007)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/archive.cpp
    scummvm/trunk/engines/parallaction/disk.h

Modified: scummvm/trunk/engines/parallaction/archive.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/archive.cpp	2007-02-25 22:13:38 UTC (rev 25869)
+++ scummvm/trunk/engines/parallaction/archive.cpp	2007-02-25 22:17:41 UTC (rev 25870)
@@ -114,6 +114,14 @@
 	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::write(const void *dataPtr, uint32 dataSize) {
-	error("Archive files don't support writing");
-}
 
-
-
 } // namespace Parallaction

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2007-02-25 22:13:38 UTC (rev 25869)
+++ scummvm/trunk/engines/parallaction/disk.h	2007-02-25 22:17:41 UTC (rev 25870)
@@ -37,7 +37,7 @@
 
 #define DIRECTORY_OFFSET_IN_FILE	0x4000
 
-class Archive : public Common::File {
+class Archive : public Common::SeekableReadStream {
 
 protected:
 
@@ -65,10 +65,11 @@
 	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);
 };
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list