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
ArchiveWriter_Zip Class Reference
Inheritance diagram for ArchiveWriter_Zip:
IArchiveWriter

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

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
 

Detailed Description

Definition at line 586 of file archive_zip.cpp.

Constructor & Destructor Documentation

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

Definition at line 589 of file archive_zip.cpp.

ArchiveWriter_Zip::~ArchiveWriter_Zip ( )
inline

Definition at line 596 of file archive_zip.cpp.

Member Function Documentation

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.

Definition at line 613 of file archive_zip.cpp.

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

Definition at line 631 of file archive_zip.cpp.

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.

Definition at line 624 of file archive_zip.cpp.

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

Definition at line 715 of file archive_zip.cpp.

Member Data Documentation

Pool ArchiveWriter_Zip::m_cdfhPool
private

Definition at line 739 of file archive_zip.cpp.

PFile ArchiveWriter_Zip::m_file
private

Definition at line 736 of file archive_zip.cpp.

off_t ArchiveWriter_Zip::m_fileSize
private

Definition at line 737 of file archive_zip.cpp.

bool ArchiveWriter_Zip::m_noDeflate
private

Definition at line 742 of file archive_zip.cpp.

size_t ArchiveWriter_Zip::m_numEntries
private

Definition at line 740 of file archive_zip.cpp.


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