ScummVM API documentation
default-saves.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#if !defined(BACKEND_SAVES_DEFAULT_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
23#define BACKEND_SAVES_DEFAULT_H
24
25#include "common/scummsys.h"
26#include "common/savefile.h"
27#include "common/str.h"
28#include "common/fs.h"
29#include "common/hash-str.h"
30
35public:
37 DefaultSaveFileManager(const Common::Path &defaultSavepath);
38
39 void updateSavefilesList(Common::StringArray &lockedFiles) override;
41 Common::InSaveFile *openRawFile(const Common::String &filename) override;
43 Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) override;
44 bool removeSavefile(const Common::String &filename) override;
45 bool exists(const Common::String &filename) override;
46
47#ifdef USE_CLOUD
48
49 static const uint32 INVALID_TIMESTAMP = UINT_MAX;
50 static const char *const TIMESTAMPS_FILENAME;
51
52 static Common::HashMap<Common::String, uint32> loadTimestamps();
53 static void saveTimestamps(Common::HashMap<Common::String, uint32> &timestamps);
54#endif
55
56 static Common::Path concatWithSavesPath(Common::String name);
57
58protected:
64 virtual Common::Path getSavePath() const;
65
70 virtual void checkPath(const Common::FSNode &dir);
71
77
83 void assureCached(const Common::Path &savePathName);
84
86
95
101
102private:
106 Common::Path _cachedDirectory;
107};
108
109#endif
Definition: fs.h:69
Definition: savefile.h:54
Definition: path.h:52
Definition: savefile.h:142
Definition: stream.h:745
Definition: str.h:59
Definition: default-saves.h:34
Common::InSaveFile * openRawFile(const Common::String &filename) override
Common::InSaveFile * openForLoading(const Common::String &filename) override
Common::StringArray listSavefiles(const Common::String &pattern) override
Common::StringArray _lockedFiles
Definition: default-saves.h:100
virtual Common::Path getSavePath() const
void updateSavefilesList(Common::StringArray &lockedFiles) override
virtual void checkPath(const Common::FSNode &dir)
bool exists(const Common::String &filename) override
Common::OutSaveFile * openForSaving(const Common::String &filename, bool compress=true) override
void assureCached(const Common::Path &savePathName)
bool removeSavefile(const Common::String &filename) override
virtual Common::ErrorCode removeFile(const Common::FSNode &fileNode)
SaveFileCache _saveFileCache
Definition: default-saves.h:94
ErrorCode
Definition: error.h:47