Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CGameLoader Class Reference

Helper class for retrieving data from saved game archives. More...

Collaboration diagram for CGameLoader:
Collaboration graph
[legend]

Public Member Functions

 CGameLoader (ScriptInterface &scriptInterface, std::string *savedState)
 
void ReadEntry (const VfsPath &pathname, const CFileInfo &fileInfo, PIArchiveFile archiveFile)
 
JS::Value GetMetadata ()
 

Static Public Member Functions

static void ReadEntryCallback (const VfsPath &pathname, const CFileInfo &fileInfo, PIArchiveFile archiveFile, uintptr_t cbData)
 

Private Member Functions

 NONCOPYABLE (CGameLoader)
 

Private Attributes

ScriptInterfacem_ScriptInterface
 
JS::PersistentRooted< JS::Value > m_Metadata
 
std::string * m_SavedState
 

Detailed Description

Helper class for retrieving data from saved game archives.

Constructor & Destructor Documentation

CGameLoader::CGameLoader ( ScriptInterface scriptInterface,
std::string *  savedState 
)
inline
Parameters
scriptInterfacethe ScriptInterface used for loading metadata.
[out]savedStateserialized simulation state stored as string of bytes, loaded from simulation.dat inside the archive.

Note: We use a different approach for returning the string and the metadata JS::Value. We use a pointer for the string to avoid copies (efficiency). We don't use this approach for the metadata because it would be error prone with rooting and the stack-based rooting types and confusing (a chain of pointers pointing to other pointers).

Member Function Documentation

JS::Value CGameLoader::GetMetadata ( )
inline
CGameLoader::NONCOPYABLE ( CGameLoader  )
private
void CGameLoader::ReadEntry ( const VfsPath pathname,
const CFileInfo fileInfo,
PIArchiveFile  archiveFile 
)
inline
static void CGameLoader::ReadEntryCallback ( const VfsPath pathname,
const CFileInfo fileInfo,
PIArchiveFile  archiveFile,
uintptr_t  cbData 
)
inlinestatic

Member Data Documentation

JS::PersistentRooted<JS::Value> CGameLoader::m_Metadata
private
std::string* CGameLoader::m_SavedState
private
ScriptInterface& CGameLoader::m_ScriptInterface
private

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