#include <SavegameWriter.h>
Public Member Functions | |
SavegameWriter (ODataSource *ds) | |
virtual | ~SavegameWriter () |
bool | writeDescription (const std::string &desc) |
bool | writeVersion (uint32 version) |
virtual bool | writeFile (const char *name, const uint8 *data, uint32 size) |
bool | writeFile (const char *name, OAutoBufferDataSource *buf) |
bool | finish () |
Protected Attributes | |
ODataSource * | ds |
std::string | comment |
void * | zipfile |
Definition at line 25 of file SavegameWriter.h.
SavegameWriter::SavegameWriter | ( | ODataSource * | ds | ) | [explicit] |
Definition at line 44 of file SavegameWriter.cpp.
References ds, ODS_filefunc_templ, PentZip::zlib_filefunc_def_s::opaque, zipfile, and PentZip::zipOpen2().
SavegameWriter::~SavegameWriter | ( | ) | [virtual] |
bool SavegameWriter::finish | ( | ) |
finish savegame
Definition at line 62 of file SavegameWriter.cpp.
References comment, PentZip::zipClose(), and zipfile.
Referenced by GUIApp::saveGame().
bool SavegameWriter::writeDescription | ( | const std::string & | desc | ) |
write the savegame's description.
Definition at line 111 of file SavegameWriter.cpp.
References comment.
Referenced by GUIApp::saveGame().
bool SavegameWriter::writeFile | ( | const char * | name, | |
OAutoBufferDataSource * | buf | |||
) |
write a file to the savegame from an OAutoBufferDataSource
name | name of the file | |
buf | the OBufferDataSource to save |
Definition at line 96 of file SavegameWriter.cpp.
References OAutoBufferDataSource::getBuf(), OAutoBufferDataSource::getSize(), and writeFile().
write a file to the savegame
name | name of the file | |
data | the data | |
size | (in bytes) of data |
Definition at line 72 of file SavegameWriter.cpp.
References perr, PentZip::zipCloseFileInZip(), zipfile, PentZip::zipOpenNewFileInZip(), and PentZip::zipWriteInFileInZip().
Referenced by GUIApp::saveGame(), writeFile(), and writeVersion().
bool SavegameWriter::writeVersion | ( | uint32 | version | ) |
write the savegame's global version
Definition at line 101 of file SavegameWriter.cpp.
References writeFile().
Referenced by GUIApp::saveGame().
std::string SavegameWriter::comment [protected] |
ODataSource* SavegameWriter::ds [protected] |
Definition at line 52 of file SavegameWriter.h.
Referenced by SavegameWriter(), and ~SavegameWriter().
void* SavegameWriter::zipfile [protected] |
Definition at line 54 of file SavegameWriter.h.
Referenced by finish(), SavegameWriter(), and writeFile().