aboutsummaryrefslogtreecommitdiff
path: root/common/savefile.h
diff options
context:
space:
mode:
authorMax Horn2006-04-26 11:15:13 +0000
committerMax Horn2006-04-26 11:15:13 +0000
commit0aaa04899cf77abe98148882429440ca8804dfe2 (patch)
tree94d7c51d0ab0e0aab19a441c3a3547cc8cbc08ac /common/savefile.h
parent46058e8d17a1178fb856dbbf4aad1eb94f4040ca (diff)
downloadscummvm-rg350-0aaa04899cf77abe98148882429440ca8804dfe2.tar.gz
scummvm-rg350-0aaa04899cf77abe98148882429440ca8804dfe2.tar.bz2
scummvm-rg350-0aaa04899cf77abe98148882429440ca8804dfe2.zip
Changed InSaveFile (part of the save file system) to inherit from SeekableReadStream, meaning that savegames opened for reading now are seekable (DC, PS2, Palm ports will have to be updated accordingly)
svn-id: r22180
Diffstat (limited to 'common/savefile.h')
-rw-r--r--common/savefile.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/common/savefile.h b/common/savefile.h
index af9afbb72e..d85d03268c 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -34,14 +34,7 @@ namespace Common {
* That typically means "save games", but also includes things like the
* IQ points in Indy3.
*/
-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;
+class InSaveFile : public SeekableReadStream {
};
/**
@@ -49,9 +42,7 @@ public:
* That typically means "save games", but also includes things like the
* IQ points in Indy3.
*/
-class OutSaveFile : public Common::WriteStream {
-public:
- virtual ~OutSaveFile() {}
+class OutSaveFile : public WriteStream {
};
/**
@@ -69,20 +60,30 @@ public:
/**
* Open the file with name filename in the given directory for saving.
* @param filename the filename
- * @return pointer to a SaveFile object, or NULL if an error occured.
+ * @return pointer to an OutSaveFile, or NULL if an error occured.
*/
virtual OutSaveFile *openForSaving(const char *filename) = 0;
/**
* Open the file with name filename in the given directory for loading.
* @param filename the filename
- * @return pointer to a SaveFile object, or NULL if an error occured.
+ * @return pointer to an InSaveFile, or NULL if an error occured.
*/
virtual InSaveFile *openForLoading(const char *filename) = 0;
+ /**
+ * Request a list of available savegames with a given prefix.
+ * TODO: Document this better!
+ * TODO: Or even replace it with a better API. For example, one that
+ * returns a list of strings for all present file names.
+ */
virtual void listSavefiles(const char * /* prefix */, bool *marks, int num) = 0;
- /** Get the path to the save game directory. */
+ /**
+ * Get the path to the save game directory.
+ * Should only be used for error messages, and not to construct file paths
+ * from it, since that is highl unportable.
+ */
virtual const char *getSavePath() const;
};
@@ -91,9 +92,6 @@ public:
virtual OutSaveFile *openForSaving(const char *filename);
virtual InSaveFile *openForLoading(const char *filename);
virtual void listSavefiles(const char * /* prefix */, bool *marks, int num);
-
-protected:
- SaveFile *makeSaveFile(const char *filename, bool saveOrLoad);
};
} // End of namespace Common