aboutsummaryrefslogtreecommitdiff
path: root/common/savefile.h
diff options
context:
space:
mode:
authorMax Horn2007-02-17 18:55:51 +0000
committerMax Horn2007-02-17 18:55:51 +0000
commitb8aeefaffb2ecdc9da5594a49cfba87a84e55d4e (patch)
tree4115d12166111ec170729e268f9161dd5b6b2009 /common/savefile.h
parent7d5d6c2f91287a286a65fe652c62462dce9b2e62 (diff)
downloadscummvm-rg350-b8aeefaffb2ecdc9da5594a49cfba87a84e55d4e.tar.gz
scummvm-rg350-b8aeefaffb2ecdc9da5594a49cfba87a84e55d4e.tar.bz2
scummvm-rg350-b8aeefaffb2ecdc9da5594a49cfba87a84e55d4e.zip
Added finalize() method to Common::OutSaveFile (which by default just flushes the stream), changed engines to call that before deleting OutSaveFile instances (instead of just flushing)
svn-id: r25660
Diffstat (limited to 'common/savefile.h')
-rw-r--r--common/savefile.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/common/savefile.h b/common/savefile.h
index cacb0bfaff..1e48bafdfd 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -41,7 +41,20 @@ class InSaveFile : public SeekableReadStream {};
* That typically means "save games", but also includes things like the
* IQ points in Indy3.
*/
-class OutSaveFile : public WriteStream {};
+class OutSaveFile : public WriteStream {
+public:
+ /**
+ * Close this savefile, to be called right before destruction of this
+ * savefile. The idea is that this ways, I/O errors that occur
+ * during closing/flushing of the file can still be handled by the
+ * game engine.
+ *
+ * By default, this just flushes the stream.
+ */
+ virtual void finalize() {
+ flush();
+ }
+};
/**
* Convenience intermediate class, to be removed.