#include <savefile.h>
Public Member Functions | |
virtual void | clearError () |
virtual Error | getError () |
virtual String | getErrorDesc () |
virtual String | popErrorDesc () |
virtual OutSaveFile * | openForSaving (const String &name, bool compress=true)=0 |
virtual InSaveFile * | openForLoading (const String &name)=0 |
virtual InSaveFile * | openRawFile (const String &name)=0 |
virtual bool | removeSavefile (const String &name)=0 |
virtual bool | renameSavefile (const String &oldName, const String &newName, bool compress=true) |
virtual bool | copySavefile (const String &oldName, const String &newName, bool compress=true) |
virtual StringArray | listSavefiles (const String &pattern)=0 |
virtual void | updateSavefilesList (StringArray &lockedFiles)=0 |
virtual bool | exists (const String &name)=0 |
Protected Member Functions | |
virtual void | setError (Error error, const String &errorDesc) |
Protected Attributes | |
Error | _error |
String | _errorDesc |
The SaveFileManager serves as a factory for InSaveFile and OutSaveFile objects.
Engines and other code should use SaveFiles whenever they need to store data that they need to retrieve again later on – i.e. typically save states, but also configuration files and similar objects.
Save file names represent SaveFiles. These names are case insensitive. That means a name of "Kq1.000" represents the same save file as "kq1.000". In addition, SaveFileManager does not allow for names that contain path separators like '/' or '\'. This is because directories are not supported in SaveFileManager.
While not declared as a singleton, it is effectively used as such, with OSystem::getSavefileManager returning a pointer to single SaveFileManager instances to be used.
|
inlineprotectedvirtual |
Set some information about the last error that occurred.
error | Code identifying the last error. |
errorDesc | String describing the last error. |
|
inlinevirtual |
Clear the last set error code and string.
|
inlinevirtual |
Return the last occurred error code. If none occurred, return kNoError.
|
inlinevirtual |
Return the last occurred error description. If none occurred, return 0.
|
virtual |
Return the last occurred error description. If none occurred, return 0. Also, clear the last error state and description.
|
pure virtual |
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. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
pure virtual |
Open the file with the specified name
in the given directory for loading.
name | Name of the save file. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
pure virtual |
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. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
pure virtual |
Remove the given save file from the system.
name | Name of the save file to be removed. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
virtual |
Rename the given save file.
oldName | Old name. |
newName | New name. |
compress | Whether to compress the resulting save file (default) or not. |
|
virtual |
Copy the given save file.
oldName | Old name. |
newName | New name. |
compress | Whether to compress the resulting save file (default) or not. |
|
pure virtual |
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. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
pure virtual |
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.
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
pure virtual |
Checks if the savefile exists.
name | Name of the save file. |
Implemented in PAKSaveManager, FRAMSaveManager, and DefaultSaveFileManager.
|
protected |
Description of an error.