[Scummvm-cvs-logs] CVS: scummvm/common savefile.h,1.17,1.18 savefile.cpp,1.21,1.22

Max Horn fingolfin at users.sourceforge.net
Sun May 8 16:33:39 CEST 2005


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18927

Modified Files:
	savefile.h savefile.cpp 
Log Message:
New method InSaveFile::skip()

Index: savefile.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/savefile.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- savefile.h	22 Apr 2005 17:40:07 -0000	1.17
+++ savefile.h	8 May 2005 23:32:31 -0000	1.18
@@ -31,23 +31,21 @@
  * A class which allows game engines to load game state data.
  * That typically means "save games", but also includes things like the
  * IQ points in Indy3.
- *
- * @todo Add error checking abilities.
- * @todo Change base class to SeekableReadStream; or alternatively,
- *       add a simple 'skip()' method which would allow skipping
- *       a number of bytes in the savefile.
  */
 class InSaveFile : public Common::ReadStream {
 public:
 	virtual ~InSaveFile() {}
+	
+	/**
+	 * Skip over the specified (positive) amount of bytes in the input stream.
+	 */
+	virtual void skip(uint32 offset) = 0;
 };
 
 /**
  * A class which allows game engines to save game state data.
  * That typically means "save games", but also includes things like the
  * IQ points in Indy3.
- *
- * @todo Add error checking abilities.
  */
 class OutSaveFile : public Common::WriteStream {
 public:

Index: savefile.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/savefile.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- savefile.cpp	8 May 2005 21:49:32 -0000	1.21
+++ savefile.cpp	8 May 2005 23:32:31 -0000	1.22
@@ -31,6 +31,7 @@
 #include <zlib.h>
 #endif
 
+
 const char *SaveFileManager::getSavePath() const {
 
 #if defined(__PALM_OS__)
@@ -85,6 +86,10 @@
 	uint32 write(const void *dataPtr, uint32 dataSize) {
 		return ::fwrite(dataPtr, 1, dataSize, fh);
 	}
+
+	void skip(uint32 offset) {
+		::fseek(fh, offset, SEEK_SET);
+	}
 };
 
 
@@ -128,6 +133,10 @@
 			_ioError = true;
 		return ret;
 	}
+
+	void skip(uint32 offset) {
+		::gzseek(fh, offset, SEEK_SET);
+	}
 };
 #endif
 





More information about the Scummvm-git-logs mailing list