ScummVM API documentation
Gob::SaveLoad Class Reference

#include <saveload.h>

Inheritance diagram for Gob::SaveLoad:
Gob::SaveLoad_Adibou1 Gob::SaveLoad_Fascination Gob::SaveLoad_Geisha Gob::SaveLoad_Inca2 Gob::SaveLoad_Playtoons Gob::SaveLoad_v2 Gob::SaveLoad_v3 Gob::SaveLoad_v4 Gob::SaveLoad_v6 Gob::SaveLoad_v7

Public Types

enum  SaveMode { kSaveModeNone, kSaveModeIgnore, kSaveModeExists, kSaveModeSave }
 

Public Member Functions

 SaveLoad (GobEngine *vm)
 
virtual SaveMode getSaveMode (const char *fileName) const
 
virtual Common::List< Common::StringgetFilesMatchingPattern (const char *pattern) const
 
int32 getSize (const char *fileName)
 
bool load (const char *fileName, int16 dataVar, int32 size, int32 offset)
 
bool loadToRaw (const char *fileName, byte *ptr, int32 size, int32 offset)
 
bool save (const char *fileName, int16 dataVar, int32 size, int32 offset)
 
bool saveFromRaw (const char *fileName, byte *ptr, int32 size, int32 offset)
 
bool copySaveGame (const char *fileNameSrc, const char *fileNameDest)
 
bool deleteFile (const char *fileName)
 

Static Public Member Functions

static const char * stripPath (const char *fileName, char separator='\\')
 
static Common::String replacePathSeparators (const char *path, char newSeparator)
 

Protected Member Functions

virtual SaveHandlergetHandler (const char *fileName) const
 
virtual const char * getDescription (const char *fileName) const
 

Protected Attributes

GobEngine_vm
 

Detailed Description

A system for saving and loading.

Member Enumeration Documentation

◆ SaveMode

How to handle the specific save.

Enumerator
kSaveModeNone 

Don't handle it.

kSaveModeIgnore 

Ignore it.

kSaveModeExists 

Just claim it exists.

kSaveModeSave 

A normal save.

Constructor & Destructor Documentation

◆ SaveLoad()

Gob::SaveLoad::SaveLoad ( GobEngine vm)

The constructor.

Parameters
targetNameThe game's target name. Used as a base for the save names.

Member Function Documentation

◆ stripPath()

static const char* Gob::SaveLoad::stripPath ( const char *  fileName,
char  separator = '\\' 
)
static

"foo\bar\quux.bla" => "quux.bla".

◆ replacePathSeparators()

static Common::String Gob::SaveLoad::replacePathSeparators ( const char *  path,
char  newSeparator 
)
static

Changes all file separator characters (/,:,) in path to newSeparator

◆ getSaveMode()

virtual SaveMode Gob::SaveLoad::getSaveMode ( const char *  fileName) const
virtual

◆ getFilesMatchingPattern()

virtual Common::List<Common::String> Gob::SaveLoad::getFilesMatchingPattern ( const char *  pattern) const
virtual

Returns all files known by the saving system matching a pattern.

Reimplemented in Gob::SaveLoad_v7.

◆ getSize()

int32 Gob::SaveLoad::getSize ( const char *  fileName)

Returns the file's (virtual) size.

◆ load()

bool Gob::SaveLoad::load ( const char *  fileName,
int16  dataVar,
int32  size,
int32  offset 
)

Loads size bytes from offset into the variables starting with dataVar.

◆ save()

bool Gob::SaveLoad::save ( const char *  fileName,
int16  dataVar,
int32  size,
int32  offset 
)

Saves size bytes from the variables starting with data dataVar at offset.

◆ deleteFile()

bool Gob::SaveLoad::deleteFile ( const char *  fileName)

Deletes the file.


The documentation for this class was generated from the following file: