#include <default-saves.h>
Public Member Functions | |
DefaultSaveFileManager (const Common::Path &defaultSavepath) | |
void | updateSavefilesList (Common::StringArray &lockedFiles) override |
Common::StringArray | listSavefiles (const Common::String &pattern) override |
Common::InSaveFile * | openRawFile (const Common::String &filename) override |
Common::InSaveFile * | openForLoading (const Common::String &filename) override |
Common::OutSaveFile * | openForSaving (const Common::String &filename, bool compress=true) override |
bool | removeSavefile (const Common::String &filename) override |
bool | exists (const Common::String &filename) override |
Public Member Functions inherited from Common::SaveFileManager | |
virtual void | clearError () |
virtual Error | getError () |
virtual String | getErrorDesc () |
virtual String | popErrorDesc () |
virtual bool | renameSavefile (const String &oldName, const String &newName, bool compress=true) |
virtual bool | copySavefile (const String &oldName, const String &newName, bool compress=true) |
Static Public Member Functions | |
static Common::Path | concatWithSavesPath (Common::String name) |
Protected Types | |
typedef Common::HashMap< Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo > | SaveFileCache |
Protected Member Functions | |
virtual Common::Path | getSavePath () const |
virtual void | checkPath (const Common::FSNode &dir) |
virtual Common::ErrorCode | removeFile (const Common::FSNode &fileNode) |
void | assureCached (const Common::Path &savePathName) |
Protected Member Functions inherited from Common::SaveFileManager | |
virtual void | setError (Error error, const String &errorDesc) |
Protected Attributes | |
SaveFileCache | _saveFileCache |
Common::StringArray | _lockedFiles |
Protected Attributes inherited from Common::SaveFileManager | |
Error | _error |
String | _errorDesc |
Provides a default savefile manager implementation for common platforms.
|
overridevirtual |
Refresh the save files list (because some new files might have been added) and remember the "locked" files list. These files cannot be used for saving or loading because they are being synced by CloudManager.
Implements Common::SaveFileManager.
|
overridevirtual |
List available save files matching a given pattern.
The pattern format is based on DOS patterns, also known as "glob" in the POSIX world. Refer to the Common::matchString() function for information about the precise pattern format.
pattern | Pattern to match. Wildcards like * or ? are allowed. |
Implements Common::SaveFileManager.
|
overridevirtual |
Open the file with the specified name in the given directory for loading. In contrast to openForLoading(), it returns a raw file instead of unpacked.
name | Name of the save file. |
Implements Common::SaveFileManager.
|
overridevirtual |
Open the file with the specified name
in the given directory for loading.
name | Name of the save file. |
Implements Common::SaveFileManager.
|
overridevirtual |
Open the save file with the specified name
in the given directory for saving.
Saved games are compressed by default, and engines are expected to always write compressed saves.
A notable exception is when uncompressed files are needed for compatibility with games not supported by ScummVM, such as character exports from the Quest for Glory series. QfG5 is a 3D game and will not be supported by ScummVM.
name | Name of the save file. |
compress | Whether to compress the resulting save file (default) or not. |
Implements Common::SaveFileManager.
|
overridevirtual |
Remove the given save file from the system.
name | Name of the save file to be removed. |
Implements Common::SaveFileManager.
|
overridevirtual |
Checks if the savefile exists.
name | Name of the save file. |
Implements Common::SaveFileManager.
|
protectedvirtual |
Get the path to the savegame directory. Should only be used internally since some platforms might implement savefiles in a completely different way.
|
protectedvirtual |
Checks the given path for read access, existence, etc. Sets the internal error and error message accordingly.
|
protectedvirtual |
Removes the given file. This is called from removeSavefile() with the full file path.
Reimplemented in WindowsSaveFileManager.
|
protected |
Assure that the given save path is cached.
savePathName | String representation of save path to cache. |
|
protected |
Cache of all the save files in the currently cached directory.
Modify with caution because we only re-cache when the save path changed! This needs to be updated inside at least openForSaving and removeSavefile.
|
protected |
List of "locked" files. These cannot be used for saving/loading because CloudManager is downloading those.