From aee713141b3a401f08e63cd9ccf5ce3dfe1cb06e Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sat, 18 Jun 2016 18:49:46 +0600 Subject: CLOUD: Make OutSaveFile start saves sync It had to become a proxy class in order to do that. finalize() starts the saves sync. --- common/savefile.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/savefile.h b/common/savefile.h index 38b21c9ddd..d84c9e275a 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -28,6 +28,7 @@ #include "common/stream.h" #include "common/str-array.h" #include "common/error.h" +#include "common/ptr.h" namespace Common { @@ -44,8 +45,20 @@ typedef SeekableReadStream InSaveFile; * That typically means "save games", but also includes things like the * IQ points in Indy3. */ -typedef WriteStream OutSaveFile; +class OutSaveFile: public WriteStream { +protected: + ScopedPtr _wrapped; +public: + OutSaveFile(WriteStream *w); + virtual ~OutSaveFile(); + + virtual bool err() const; + virtual void clearErr(); + virtual void finalize(); + virtual bool flush(); + virtual uint32 write(const void *dataPtr, uint32 dataSize); +}; /** * The SaveFileManager is serving as a factory for InSaveFile -- cgit v1.2.3