Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
ArchiveWriter_Zip Class Reference
Inheritance diagram for ArchiveWriter_Zip:
Collaboration diagram for ArchiveWriter_Zip:

Public Member Functions

 ArchiveWriter_Zip (const OsPath &archivePathname, bool noDeflate)
 
 ~ArchiveWriter_Zip ()
 
Status AddFile (const OsPath &pathname, const OsPath &pathnameInArchive)
 add a file to the archive. More...
 
Status AddMemory (const u8 *data, size_t size, time_t mtime, const OsPath &pathnameInArchive)
 add a file to the archive, when it is already in memory and not on disk. More...
 
Status AddFileOrMemory (const CFileInfo &fileInfo, const OsPath &pathnameInArchive, const PFile &file, const u8 *data)
 
- Public Member Functions inherited from IArchiveWriter
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...
 

Static Private Member Functions

static bool IsFileTypeIncompressible (const OsPath &pathname)
 

Private Attributes

PFile m_file
 
off_t m_fileSize
 
Pool m_cdfhPool
 
size_t m_numEntries
 
bool m_noDeflate
 

Constructor & Destructor Documentation

◆ ArchiveWriter_Zip()

ArchiveWriter_Zip::ArchiveWriter_Zip ( const OsPath archivePathname,
bool  noDeflate 
)
inline

◆ ~ArchiveWriter_Zip()

ArchiveWriter_Zip::~ArchiveWriter_Zip ( )
inline

Member Function Documentation

◆ AddFile()

Status ArchiveWriter_Zip::AddFile ( const OsPath pathname,
const OsPath pathnameInArchive 
)
inlinevirtual

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

Implements IArchiveWriter.

◆ AddFileOrMemory()

Status ArchiveWriter_Zip::AddFileOrMemory ( const CFileInfo fileInfo,
const OsPath pathnameInArchive,
const PFile file,
const u8 data 
)
inline

◆ AddMemory()

Status ArchiveWriter_Zip::AddMemory ( const u8 data,
size_t  size,
time_t  mtime,
const OsPath pathnameInArchive 
)
inlinevirtual

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

Implements IArchiveWriter.

◆ IsFileTypeIncompressible()

static bool ArchiveWriter_Zip::IsFileTypeIncompressible ( const OsPath pathname)
inlinestaticprivate

Member Data Documentation

◆ m_cdfhPool

Pool ArchiveWriter_Zip::m_cdfhPool
private

◆ m_file

PFile ArchiveWriter_Zip::m_file
private

◆ m_fileSize

off_t ArchiveWriter_Zip::m_fileSize
private

◆ m_noDeflate

bool ArchiveWriter_Zip::m_noDeflate
private

◆ m_numEntries

size_t ArchiveWriter_Zip::m_numEntries
private

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