Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
IArchiveWriter Struct Referenceabstract

#include <archive.h>

Inheritance diagram for IArchiveWriter:

Public Member Functions

virtual ~IArchiveWriter ()
 write out the archive to disk; only hereafter is it valid. More...
 
virtual Status AddFile (const OsPath &pathname, const Path &pathnameInArchive)=0
 add a file to the archive. More...
 
virtual Status AddMemory (const u8 *data, size_t size, time_t mtime, const OsPath &pathnameInArchive)=0
 add a file to the archive, when it is already in memory and not on disk. More...
 

Constructor & Destructor Documentation

◆ ~IArchiveWriter()

IArchiveWriter::~IArchiveWriter ( )
virtual

write out the archive to disk; only hereafter is it valid.

Member Function Documentation

◆ AddFile()

virtual Status IArchiveWriter::AddFile ( const OsPath pathname,
const Path pathnameInArchive 
)
pure virtual

add a file to the archive.

rationale: passing in a filename instead of the compressed file contents makes for better encapsulation because callers don't need to know about the codec. one disadvantage is that loading the file contents can no longer take advantage of the VFS cache nor previously archived versions. however, the archive builder usually adds files precisely because they aren't in archives, and the cache would thrash anyway, so this is deemed acceptable.

Parameters
pathnamethe actual file to add
pathnameInArchivethe name to store in the archive

Implemented in ArchiveWriter_Zip.

◆ AddMemory()

virtual Status IArchiveWriter::AddMemory ( const u8 data,
size_t  size,
time_t  mtime,
const OsPath pathnameInArchive 
)
pure virtual

add a file to the archive, when it is already in memory and not on disk.

Parameters
datathe uncompressed file contents to add
sizethe length of data
mtimethe last-modified-time to be stored in the archive
pathnameInArchivethe name to store in the archive

Implemented in ArchiveWriter_Zip.


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