Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
CArchiveBuilder Class Reference

Packages a mod's files into a distributable archive. More...

#include <ArchiveBuilder.h>

Public Member Functions

 CArchiveBuilder (const OsPath &mod, const OsPath &tempdir)
 Initialise the archive builder for processing the given mod. More...
 
 ~CArchiveBuilder ()
 
void AddBaseMod (const OsPath &mod)
 Add a mod which will be loaded but not archived, to provide files like textures.xml needed for the conversion. More...
 
void Build (const OsPath &archive, bool compress)
 Do all the processing and packing of files into the archive. More...
 

Static Private Member Functions

static Status CollectFileCB (const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData)
 

Private Attributes

PIVFS m_VFS
 
std::vector< VfsPathm_Files
 
OsPath m_TempDir
 

Detailed Description

Packages a mod's files into a distributable archive.

This includes various game-specific knowledge on how to convert and cache certain files into more efficient formats (PNG -> DDS, etc).

Definition at line 29 of file ArchiveBuilder.h.

Constructor & Destructor Documentation

CArchiveBuilder::CArchiveBuilder ( const OsPath mod,
const OsPath tempdir 
)

Initialise the archive builder for processing the given mod.

Assumes no graphics code (especially tex_codec) has been initialised yet.

Parameters
modpath to data/mods/foo directory, containing files for conversion
tempdirpath to a writable directory for temporary files

Definition at line 36 of file ArchiveBuilder.cpp.

CArchiveBuilder::~CArchiveBuilder ( )

Definition at line 53 of file ArchiveBuilder.cpp.

Member Function Documentation

void CArchiveBuilder::AddBaseMod ( const OsPath mod)

Add a mod which will be loaded but not archived, to provide files like textures.xml needed for the conversion.

Typically this will be called with 'public', when packaging a user's mod.

Parameters
modpath to data/mods/foo directory, containing files for loading

Definition at line 62 of file ArchiveBuilder.cpp.

void CArchiveBuilder::Build ( const OsPath archive,
bool  compress 
)

Do all the processing and packing of files into the archive.

Parameters
archivepath of .zip file to generate (will be overwritten if it exists)
compresswhether to compress the contents of the .zip file

Definition at line 67 of file ArchiveBuilder.cpp.

Status CArchiveBuilder::CollectFileCB ( const VfsPath pathname,
const CFileInfo fileInfo,
const uintptr_t  cbData 
)
staticprivate

Definition at line 176 of file ArchiveBuilder.cpp.

Member Data Documentation

std::vector<VfsPath> CArchiveBuilder::m_Files
private

Definition at line 63 of file ArchiveBuilder.h.

OsPath CArchiveBuilder::m_TempDir
private

Definition at line 64 of file ArchiveBuilder.h.

PIVFS CArchiveBuilder::m_VFS
private

Definition at line 62 of file ArchiveBuilder.h.


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