SavegameWriter Class Reference

#include <SavegameWriter.h>

List of all members.

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

ODataSourceds
std::string comment
void * zipfile


Detailed Description

Definition at line 25 of file SavegameWriter.h.


Constructor & Destructor Documentation

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]

Definition at line 55 of file SavegameWriter.cpp.

References ds.


Member Function Documentation

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

Parameters:
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().

bool SavegameWriter::writeFile ( const char *  name,
const uint8 data,
uint32  size 
) [virtual]

write a file to the savegame

Parameters:
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().


Member Data Documentation

std::string SavegameWriter::comment [protected]

Definition at line 53 of file SavegameWriter.h.

Referenced by finish(), and writeDescription().

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().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:51 2007 for pentagram by  doxygen 1.4.7