aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2005-05-08 23:32:31 +0000
committerMax Horn2005-05-08 23:32:31 +0000
commit5702c16c16dcf8c4971e9c4f0232340366dc1916 (patch)
tree87dbad05360513424bd37553eedb915124f65f2c /common
parent9b8d88a1136ba5c86498cc9367f0d4b942610c68 (diff)
downloadscummvm-rg350-5702c16c16dcf8c4971e9c4f0232340366dc1916.tar.gz
scummvm-rg350-5702c16c16dcf8c4971e9c4f0232340366dc1916.tar.bz2
scummvm-rg350-5702c16c16dcf8c4971e9c4f0232340366dc1916.zip
New method InSaveFile::skip()
svn-id: r17979
Diffstat (limited to 'common')
-rw-r--r--common/savefile.cpp9
-rw-r--r--common/savefile.h12
2 files changed, 14 insertions, 7 deletions
diff --git a/common/savefile.cpp b/common/savefile.cpp
index 2210f3d05a..5a8158799d 100644
--- a/common/savefile.cpp
+++ b/common/savefile.cpp
@@ -31,6 +31,7 @@
#include <zlib.h>
#endif
+
const char *SaveFileManager::getSavePath() const {
#if defined(__PALM_OS__)
@@ -85,6 +86,10 @@ public:
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 @@ public:
_ioError = true;
return ret;
}
+
+ void skip(uint32 offset) {
+ ::gzseek(fh, offset, SEEK_SET);
+ }
};
#endif
diff --git a/common/savefile.h b/common/savefile.h
index 4b4771daa9..e8496a8a4c 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -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: