liblcf
LSD_Reader Namespace Reference

Classes

struct  ChunkSave
 
struct  ChunkSaveActor
 
struct  ChunkSaveCommonEvent
 
struct  ChunkSaveEasyRpgData
 
struct  ChunkSaveEventExecFrame
 
struct  ChunkSaveEventExecState
 
struct  ChunkSaveInventory
 
struct  ChunkSaveMapEvent
 
struct  ChunkSaveMapEventBase
 
struct  ChunkSaveMapInfo
 
struct  ChunkSavePanorama
 
struct  ChunkSavePartyLocation
 
struct  ChunkSavePicture
 
struct  ChunkSaveScreen
 
struct  ChunkSaveSystem
 
struct  ChunkSaveTarget
 
struct  ChunkSaveTitle
 
struct  ChunkSaveVehicleLocation
 

Functions

double ToTDateTime (std::time_t const t)
 
std::time_t ToUnixTimestamp (double const ms)
 
double GenerateTimestamp (std::time_t const t=std::time(NULL))
 
void PrepareSave (RPG::Save &save, int32_t version=0)
 
RPG::Save ClearDefaults (const RPG::Save &save, const RPG::MapInfo &map_info, const RPG::Map &map)
 
std::unique_ptr< RPG::SaveLoad (const std::string &filename, const std::string &encoding)
 
bool Save (const std::string &filename, const RPG::Save &save, const std::string &encoding)
 
bool SaveXml (const std::string &filename, const RPG::Save &save)
 
std::unique_ptr< RPG::SaveLoadXml (const std::string &filename)
 
std::unique_ptr< RPG::SaveLoad (std::istream &filestream, const std::string &encoding)
 
bool Save (std::ostream &filestream, const RPG::Save &save, const std::string &encoding)
 
bool SaveXml (std::ostream &filestream, const RPG::Save &save)
 
std::unique_ptr< RPG::SaveLoadXml (std::istream &filestream)
 

Detailed Description

LSD Reader namespace.

Function Documentation

◆ ClearDefaults()

RPG::Save LSD_Reader::ClearDefaults ( const RPG::Save save,
const RPG::MapInfo map_info,
const RPG::Map map 
)

Returns a copy of the save data with defaults cleared.

Definition at line 137 of file lsd_reader.cpp.

References RPG::Save::system, and RPG::SaveSystem::UnFixup().

+ Here is the call graph for this function:

◆ GenerateTimestamp()

double LSD_Reader::GenerateTimestamp ( std::time_t const  t = std::time(NULL))

Returns current system time encoded in Delphi's TDateTime format.

Definition at line 31 of file lsd_reader.cpp.

References ToTDateTime().

Referenced by PrepareSave().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Load() [1/2]

std::unique_ptr< RPG::Save > LSD_Reader::Load ( const std::string &  filename,
const std::string &  encoding 
)

Loads Savegame.

Definition at line 41 of file lsd_reader.cpp.

◆ Load() [2/2]

std::unique_ptr< RPG::Save > LSD_Reader::Load ( std::istream &  filestream,
const std::string &  encoding 
)

Loads Savegame.

Definition at line 77 of file lsd_reader.cpp.

References LcfReader::IsOk(), LcfReader::ReadInt(), Struct< S >::ReadLcf(), LcfReader::ReadString(), LDB_Reader::Save(), and LcfReader::SetError().

+ Here is the call graph for this function:

◆ LoadXml() [1/2]

std::unique_ptr< RPG::Save > LSD_Reader::LoadXml ( const std::string &  filename)

Loads Savegame as XML.

Definition at line 68 of file lsd_reader.cpp.

◆ LoadXml() [2/2]

std::unique_ptr< RPG::Save > LSD_Reader::LoadXml ( std::istream &  filestream)

Loads Savegame as XML.

Definition at line 124 of file lsd_reader.cpp.

References XmlReader::IsOk(), XmlReader::Parse(), LDB_Reader::Save(), LcfReader::SetError(), and XmlReader::SetHandler().

+ Here is the call graph for this function:

◆ PrepareSave()

void LSD_Reader::PrepareSave ( RPG::Save save,
int32_t  version = 0 
)

Increment the save save_count and update the timestamp.

Definition at line 35 of file lsd_reader.cpp.

References RPG::Save::easyrpg_data, GenerateTimestamp(), RPG::SaveSystem::save_count, RPG::Save::system, RPG::SaveTitle::timestamp, RPG::Save::title, and RPG::SaveEasyRpgData::version.

+ Here is the call graph for this function:

◆ Save() [1/2]

bool LSD_Reader::Save ( const std::string &  filename,
const RPG::Save save,
const std::string &  encoding 
)

Saves Savegame.

Definition at line 50 of file lsd_reader.cpp.

◆ Save() [2/2]

bool LSD_Reader::Save ( std::ostream &  filestream,
const RPG::Save save,
const std::string &  encoding 
)

Saves Savegame.

Definition at line 97 of file lsd_reader.cpp.

References LcfWriter::IsOk(), LcfReader::SetError(), LcfWriter::Write(), LcfWriter::WriteInt(), and Struct< S >::WriteLcf().

+ Here is the call graph for this function:

◆ SaveXml() [1/2]

bool LSD_Reader::SaveXml ( const std::string &  filename,
const RPG::Save save 
)

Definition at line 59 of file lsd_reader.cpp.

◆ SaveXml() [2/2]

bool LSD_Reader::SaveXml ( std::ostream &  filestream,
const RPG::Save save 
)

Definition at line 111 of file lsd_reader.cpp.

References XmlWriter::BeginElement(), XmlWriter::EndElement(), XmlWriter::IsOk(), LcfReader::SetError(), and Struct< S >::WriteXml().

+ Here is the call graph for this function:

◆ ToTDateTime()

double LSD_Reader::ToTDateTime ( std::time_t const  t)

Converts from UNIX timestamp to Delphi's TDateTime format.

Definition at line 22 of file lsd_reader.cpp.

Referenced by GenerateTimestamp().

+ Here is the caller graph for this function:

◆ ToUnixTimestamp()

std::time_t LSD_Reader::ToUnixTimestamp ( double const  ms)

Converts from Delphi's TDateTime format to UNIX timestamp.

Definition at line 27 of file lsd_reader.cpp.