aboutsummaryrefslogtreecommitdiff
path: root/backends/saves/savefile.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-18 18:49:46 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitaee713141b3a401f08e63cd9ccf5ce3dfe1cb06e (patch)
tree20fb764d74405090278d2b498076c05fe22e266c /backends/saves/savefile.cpp
parent81106b04440d76238da0fa0166eb3032b6db591e (diff)
downloadscummvm-rg350-aee713141b3a401f08e63cd9ccf5ce3dfe1cb06e.tar.gz
scummvm-rg350-aee713141b3a401f08e63cd9ccf5ce3dfe1cb06e.tar.bz2
scummvm-rg350-aee713141b3a401f08e63cd9ccf5ce3dfe1cb06e.zip
CLOUD: Make OutSaveFile start saves sync
It had to become a proxy class in order to do that. finalize() starts the saves sync.
Diffstat (limited to 'backends/saves/savefile.cpp')
-rw-r--r--backends/saves/savefile.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index b04c53d832..1f007ca713 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -23,9 +23,33 @@
#include "common/util.h"
#include "common/savefile.h"
#include "common/str.h"
+#ifdef USE_CLOUD
+#include "backends/cloud/cloudmanager.h"
+#endif
namespace Common {
+OutSaveFile::OutSaveFile(WriteStream *w): _wrapped(w) {}
+
+OutSaveFile::~OutSaveFile() {}
+
+bool OutSaveFile::err() const { return _wrapped->err(); }
+
+void OutSaveFile::clearErr() { _wrapped->clearErr(); }
+
+void OutSaveFile::finalize() {
+ _wrapped->finalize();
+#ifdef USE_CLOUD
+ CloudMan.syncSaves();
+#endif
+}
+
+bool OutSaveFile::flush() { return _wrapped->flush(); }
+
+uint32 OutSaveFile::write(const void *dataPtr, uint32 dataSize) {
+ return _wrapped->write(dataPtr, dataSize);
+}
+
bool SaveFileManager::copySavefile(const String &oldFilename, const String &newFilename) {
InSaveFile *inFile = 0;
OutSaveFile *outFile = 0;