Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CArchiveBuilder Class Reference

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

#include <ArchiveBuilder.h>

Collaboration diagram for CArchiveBuilder:

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
 
size_t m_NumBaseMods
 

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

Constructor & Destructor Documentation

◆ CArchiveBuilder()

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

◆ ~CArchiveBuilder()

CArchiveBuilder::~CArchiveBuilder ( )

Member Function Documentation

◆ AddBaseMod()

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.

Added mods will be mounted with increasing priority. Typically this will be called with 'public', when packaging a user's mod.

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

◆ Build()

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

◆ CollectFileCB()

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

Member Data Documentation

◆ m_Files

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

◆ m_NumBaseMods

size_t CArchiveBuilder::m_NumBaseMods
private

◆ m_TempDir

OsPath CArchiveBuilder::m_TempDir
private

◆ m_VFS

PIVFS CArchiveBuilder::m_VFS
private

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