Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation
The ZipArchive Library

#include <ZipFileHeader.h>

Public Types

enum  StateFlags {
  sfNone = 0x00 , sfFileNameExtra = 0x01 , sfCommentExtra = 0x02 , sfStringsUnicode = 0x04 ,
  sfCustomUnicode = 0x10 , sfModified = 0x20 , sfTimesInUTC = 0x40
}

Public Member Functions

bool CompressionEfficient ()
 CZipFileHeader (const CZipFileHeader &header)
const CZipString & GetComment (bool bClearBuffer=false)
int GetCompressionLevel () const
float GetCompressionRatio ()
time_t GetCreationTime (bool bGetAsLocal=true) const
WORD GetDataDescriptorSize (bool bConsiderSignature=false) const
WORD GetDataDescriptorSize (const CZipStorage *pStorage) const
ZIP_SIZE_TYPE GetDataSize (bool bReal) const
DWORD GetEncryptedInfoSize () const
int GetEncryptionMethod () const
CZipString GetFileExtension (bool bLowerCase=false, bool bClearBuffer=true)
const CZipString & GetFileName (bool bClearBuffer=true)
CZipString GetFileTitle (bool bLowerCase=false, bool bClearBuffer=true)
time_t GetLastAccessTime (bool bGetAsLocal=true) const
DWORD GetLocalSize (bool bReal) const
time_t GetModificationTime (bool bGetAsLocal=true) const
DWORD GetOriginalAttributes () const
DWORD GetSize () const
const ZipArchiveLib::CBitFlagGetState () const
CZipStringStoreSettings GetStringStoreSettings ()
DWORD GetSystemAttr ()
int GetSystemCompatibility () const
bool HasTime () const
bool IsDataDescriptor () const
bool IsDirectory ()
bool IsEncrypted () const
bool IsModified () const
bool IsUseUtcFileTimes () const
bool IsWinZipAesEncryption () const
CZipFileHeaderoperator= (const CZipFileHeader &header)
int PredictCommentSize () const
int PredictFileNameSize () const
bool SetComment (LPCTSTR lpszComment)
void SetCreationTime (const time_t &ttime)
bool SetFileName (LPCTSTR lpszFileName, bool bInCentralOnly=false)
void SetLastAccessTime (const time_t &ttime)
void SetModificationTime (const time_t &ttime, bool bFullResolution=false)
bool SetSystemAttr (DWORD uAttr)

Public Attributes

CZipExtraField m_aCentralExtraData
 The central extra field.
CZipExtraField m_aLocalExtraData
 The local extra field. Do not modify it after you started compressing the file.
ZIP_SIZE_TYPE m_uComprSize
 The compressed size.
DWORD m_uCrc32
 The crc-32 value.
WORD m_uFlag
 A general purpose bit flag.
WORD m_uInternalAttr
 Internal file attributes.
ZIP_SIZE_TYPE m_uLocalComprSize
 The compressed size written in the local header.
ZIP_SIZE_TYPE m_uLocalUncomprSize
 The uncompressed size written in the local header.
WORD m_uMethod
 The compression method. It can be one of the CZipCompressor::CompressionMethod values.
WORD m_uModDate
 The file last modification date. Don't set directly, but rather use CZipFileHeader::SetModificationTime method.
WORD m_uModTime
 The file last modification time. Don't set directly, but rather use CZipFileHeader::SetModificationTime method.
ZIP_SIZE_TYPE m_uOffset
 Relative offset of the local header with respect to CZipFileHeader::m_uVolumeStart.
ZIP_SIZE_TYPE m_uUncomprSize
 The uncompressed size.
unsigned char m_uVersionMadeBy
 The version of the software that created the archive.
WORD m_uVersionNeeded
 The version needed to extract the file.
ZIP_VOLUME_TYPE m_uVolumeStart
 The volume number at which the compressed file starts.

Static Public Attributes

static char m_gszLocalSignature []
 The local file header signature.
static char m_gszSignature []
 The central file header signature.

Protected Member Functions

void AdjustLocalComprSize ()
void AdjustLocalComprSize (ZIP_SIZE_TYPE &uLocalComprSize)
bool CheckDataDescriptor (CZipStorage *pStorage) const
bool CheckLengths (bool bLocal) const
 CZipFileHeader (CZipCentralDir *pCentralDir)
bool NeedsDataDescriptor () const
bool NeedsSignatureInDataDescriptor (const CZipStorage *pStorage) const
void PrepareData (int iLevel, bool bSegm)
void PrepareStringBuffers ()
bool Read (bool bReadSignature)
bool ReadLocal (CZipCentralDir *pCentralDir)
void SetSystemCompatibility (int iSystemID, bool bUpdateAttr=false)
void UpdateFlag (bool bSegm)
void UpdateLocalHeader (CZipStorage *pStorage)
void UpdateLocalZip64 (bool bAdjustLocalComprSize)
DWORD Write (CZipCentralDir *pCentralDir)
void WriteCrc32 (char *pBuf) const
void WriteDataDescriptor (CZipStorage *pStorage)
void WriteLocal (CZipStorage *pStorage)
void WriteSmallDataDescriptor (char *pDest, bool bLocal=true)

Static Protected Member Functions

static bool VerifySignature (CZipAutoBuffer &buf)

Protected Attributes

bool m_bIgnoreCrc32
 The value indicating whether to ignore Crc32 checking.
CZipCentralDirm_pCentralDir
 The parent central directory. It can be NULL when the header is not a part of central directory.
time_t m_tCreationTime
 The file creation time (stored in the NTFS extra field).
time_t m_tLastAccessTime
 The file last access time (stored in the NTFS extra field).
time_t m_tModificationTime
 The file modification time (stored in the NTFS extra field).
BYTE m_uEncryptionMethod
 The file encryption method. It can be one of the CZipCryptograph::EncryptionMethod values.
DWORD m_uExternalAttr
 External file attributes.
WORD m_uLocalFileNameSize
 The local filename length.
DWORD m_uLocalHeaderSize
 The size of the local file header in bytes.

Friends

class CZipArchive
class CZipCentralDir

Detailed Description

Represents a single file stored in a zip archive.

Member Enumeration Documentation

◆ StateFlags

File header state flags.

See also
CZipArchive::UnicodeMode
Enumerator
sfNone 

No special flags set.

sfFileNameExtra 

The header uses Unicode extra header to store the filename.

sfCommentExtra 

The header uses Unicode extra header to store the comment.

sfStringsUnicode 

The header uses UTF-8 encoding when storing the filename and comment.

sfCustomUnicode 

The header uses custom Unicode functionality.

sfModified 

The file has been modified.

sfTimesInUTC 

The time fields are stored in UTC format.

Constructor & Destructor Documentation

◆ CZipFileHeader() [1/2]

CZipFileHeader::CZipFileHeader ( CZipCentralDir * pCentralDir)
protected

Protected constructor used by CZipCentralDir.

Parameters
pCentralDirPointer to the central directory.

◆ CZipFileHeader() [2/2]

CZipFileHeader::CZipFileHeader ( const CZipFileHeader & header)
inline

Copy constructor.

Parameters
headerThe file header to copy from.

Member Function Documentation

◆ AdjustLocalComprSize() [1/2]

void CZipFileHeader::AdjustLocalComprSize ( )
inlineprotected

Adjusts the local compressed size.

◆ AdjustLocalComprSize() [2/2]

void CZipFileHeader::AdjustLocalComprSize ( ZIP_SIZE_TYPE & uLocalComprSize)
inlineprotected

Adjusts the local compressed size.

Parameters
uLocalComprSizeThe value to adjust.

◆ CheckDataDescriptor()

bool CZipFileHeader::CheckDataDescriptor ( CZipStorage * pStorage) const
protected

Validates an existing data descriptor after file decompression.

Parameters
pStorageThe storage to read the data descriptor from.
Returns
true, if the data descriptor is valid; false otherwise.

◆ CheckLengths()

bool CZipFileHeader::CheckLengths ( bool bLocal) const
inlineprotected

Validates the member fields lengths. The tested fields are: filename, extra fields and comment.

Parameters
bLocalSet to true, if the local header lengths should be checked; false if the central header lengths should be checked.
Returns
false, if any of the lengths exceeds the allowed value.

◆ CompressionEfficient()

bool CZipFileHeader::CompressionEfficient ( )
inline

Returns the value indicating whether the compression is efficient.

Returns
true if the compression is efficient; false if the file should be stored without the compression instead.

◆ GetComment()

const CZipString & CZipFileHeader::GetComment ( bool bClearBuffer = false)

Returns the file comment.

Parameters
bClearBufferIf true, releases the internal buffer after performing the comment conversion. If false, the internal buffer is not released and both representations of the comment are kept in memory (converted and not converted). This takes more memory, but the conversion does not take place again when the central directory is written back to the archive.
Returns
The file comment.
See also
Modification of Archives: Replacing, Renaming, Deleting and Changing Data
SetComment

◆ GetCompressionLevel()

int CZipFileHeader::GetCompressionLevel ( ) const

Returns an approximate file compression level.

Returns
The compression level. May not be the real value used when compressing the file.

◆ GetCompressionRatio()

float CZipFileHeader::GetCompressionRatio ( )
inline

Returns the compression ratio.

Returns
The compression ratio of the file.

◆ GetCreationTime()

time_t CZipFileHeader::GetCreationTime ( bool bGetAsLocal = true) const

Returns the file creation time.

Parameters
bGetAsLocalIf true, returns the time as local time providing CZipFileHeader::IsUseUtcFileTimes is set to true. Otherwise, assumes the times are stored as local time and returns them the way they are stored. If false, returns the time exactly as it is stored in the archive.
Returns
The creation time.
See also
SetCreationTime
Modification of Archives: Replacing, Renaming, Deleting and Changing Data

◆ GetDataDescriptorSize() [1/2]

WORD CZipFileHeader::GetDataDescriptorSize ( bool bConsiderSignature = false) const

Returns the data descriptor size as it is required for the current file. Takes into account various factors, such as the need for the data descriptor signature or for the Zip64 format.

Parameters
bConsiderSignaturetrue, if the data descriptor signature is needed; false otherwise.
Returns
The required data descriptor size in bytes.

◆ GetDataDescriptorSize() [2/2]

WORD CZipFileHeader::GetDataDescriptorSize ( const CZipStorage * pStorage) const
inline

Returns the data descriptor size as it is required for the current file. Takes into account various factors, such as the archive segmentation type, encryption and the need for the Zip64 format.

Parameters
pStorageThe storage to test for the segmentation type.
Returns
The required data descriptor size in bytes.

◆ GetDataSize()

ZIP_SIZE_TYPE CZipFileHeader::GetDataSize ( bool bReal) const
inline

Returns the size of the compressed data.

Parameters
bRealSet to true when calling for a file already in an archive. Set to false when the header is not a part of the archive.
Returns
The compressed data size in bytes.
See also
GetEncryptedInfoSize

◆ GetEncryptedInfoSize()

DWORD CZipFileHeader::GetEncryptedInfoSize ( ) const
inline

Returns the encrypted information size. The returned value depends on the used encryption method.

Returns
The encrypted information size in bytes.

◆ GetEncryptionMethod()

int CZipFileHeader::GetEncryptionMethod ( ) const
inline

Returns the encryption method of the file.

Returns
The file encryption method. It can be one of the CZipCryptograph::EncryptionMethod values.

◆ GetFileExtension()

CZipString CZipFileHeader::GetFileExtension ( bool bLowerCase = false,
bool bClearBuffer = true )

Returns the extension of the filename. If necessary, performs the conversion using the current filename code page. Caches the result of conversion for faster access the next time.

Parameters
bLowerCaseIf true, the returned string will be lower-cased (for string comparison purposes).
bClearBufferIf true, releases the internal buffer after performing the filename conversion. If false, the internal buffer is not released and both representations of the filename are kept in memory (converted and not converted). This takes more memory, but the conversion does not take place again when the central directory is written back to the archive.
Returns
The filename extension.
See also
Unicode Support: Using Non-English Characters in Filenames, Comments and Passwords
GetFileName
SetFileName
GetFileTitle
GetStringStoreSettings
CZipStringStoreSettings::m_uNameCodePage

◆ GetFileName()

const CZipString & CZipFileHeader::GetFileName ( bool bClearBuffer = true)

Returns the filename. If necessary, performs the conversion using the current filename code page. Caches the result of conversion for faster access the next time.

Parameters
bClearBufferIf true, releases the internal buffer after performing the filename conversion. If false, the internal buffer is not released and both representations of the filename are kept in memory (converted and not converted). This takes more memory, but the conversion does not take place again when the central directory is written back to the archive.
Returns
The converted filename.
See also
Unicode Support: Using Non-English Characters in Filenames, Comments and Passwords
SetFileName
GetFileTitle
GetFileExtension
GetStringStoreSettings
CZipStringStoreSettings::m_uNameCodePage

◆ GetFileTitle()

CZipString CZipFileHeader::GetFileTitle ( bool bLowerCase = false,
bool bClearBuffer = true )

Returns the filename without the extension. If necessary, performs the conversion using the current filename code page. Caches the result of conversion for faster access the next time.

Parameters
bLowerCaseIf true, the returned string will be lower-cased (for string comparison purposes).
bClearBufferIf true, releases the internal buffer after performing the filename conversion. If false, the internal buffer is not released and both representations of the filename are kept in memory (converted and not converted). This takes more memory, but the conversion does not take place again when the central directory is written back to the archive.
Returns
The filename title.
See also
Unicode Support: Using Non-English Characters in Filenames, Comments and Passwords
GetFileName
SetFileName
GetFileExtension
GetStringStoreSettings
CZipStringStoreSettings::m_uNameCodePage

◆ GetLastAccessTime()

time_t CZipFileHeader::GetLastAccessTime ( bool bGetAsLocal = true) const

Returns the file last access time.

Parameters
bGetAsLocalIf true, returns the time as local time providing CZipFileHeader::IsUseUtcFileTimes is set to true. Otherwise, assumes the times are stored as local time and returns them the way they are stored. If false, returns the time exactly as it is stored in the archive.
Returns
The last access time.
See also
SetLastAccessTime
IsUseUtcFileTimes
SetUseTimesInUtc
Modification of Archives: Replacing, Renaming, Deleting and Changing Data

◆ GetLocalSize()

DWORD CZipFileHeader::GetLocalSize ( bool bReal) const

Returns the local header size. Before calling this method, the local information must be up-to-date (see Requesting Information, Predicting Names and Sizes for more information).

Parameters
bRealIf true, uses the real local filename size. If false, predicts the filename size.
Returns
The local header size in bytes.

◆ GetModificationTime()

time_t CZipFileHeader::GetModificationTime ( bool bGetAsLocal = true) const

Returns the file modification time.

Parameters
bGetAsLocalIf true, returns the time as local time providing CZipFileHeader::IsUseUtcFileTimes is set to true. Otherwise, assumes the times are stored as local time and returns them the way they are stored. If false, returns the time exactly as it is stored in the archive.
Returns
The modification time.
See also
SetModificationTime
IsUseUtcFileTimes
SetUseTimesInUtc

◆ GetOriginalAttributes()

DWORD CZipFileHeader::GetOriginalAttributes ( ) const
inline

Returns the file attributes exactly as they are stored in the archive.

Returns
The file attributes as they are stored in the archive. No conversion is performed.
Note
The attributes for Linux are stored shifted left by 16 bits in this field.
See also
GetSystemAttr

◆ GetSize()

DWORD CZipFileHeader::GetSize ( ) const

Returns the total size of this structure in the central directory.

Returns
The total size in bytes.

◆ GetState()

const ZipArchiveLib::CBitFlag & CZipFileHeader::GetState ( ) const
inline

Returns the state flags.

Returns
State flags. It can be one or more of StateFlags values.

◆ GetStringStoreSettings()

CZipStringStoreSettings CZipFileHeader::GetStringStoreSettings ( )
inline

Returns the current string store settings.

Returns
The string store settings.
See also
Unicode Support: Using Non-English Characters in Filenames, Comments and Passwords
CZipArchive::GetStringStoreSettings

◆ GetSystemAttr()

DWORD CZipFileHeader::GetSystemAttr ( )
inline

Returns the file attributes.

Returns
The file attributes, converted if necessary to be compatible with the current system.
Note
Throws an exception, if the archive system or the current system is not supported by the ZipArchive Library.
See also
GetOriginalAttributes

◆ GetSystemCompatibility()

int CZipFileHeader::GetSystemCompatibility ( ) const
inline

Returns the file system compatibility. External software can use this information e.g. to determine end-of-line format for text files etc. The ZipArchive Library uses it to perform a proper file attributes conversion.

Returns
The file system compatibility. It can be one of the ZipCompatibility::ZipPlatforms values.
See also
CZipArchive::GetSystemComatibility
ZipPlatform::GetSystemID

◆ HasTime()

bool CZipFileHeader::HasTime ( ) const
inline

Returns the value indicating whether the current CZipFileHeader object has the time set.

Returns
true, if the time is set; false otherwise.

◆ IsDataDescriptor()

bool CZipFileHeader::IsDataDescriptor ( ) const
inline

Returns the value indicating whether the data descriptor is present.

Returns
true, if the data descriptor is present; false otherwise.

◆ IsDirectory()

bool CZipFileHeader::IsDirectory ( )
inline

Returns the value indicating whether the file represents a directory. This method checks the file attributes. If the attributes value is zero, the method checks for the presence of a path separator at the end of the filename. If the path separator is present, the file is assumed to be a directory.

Returns
true, if the file represents a directory; false otherwise.

◆ IsEncrypted()

bool CZipFileHeader::IsEncrypted ( ) const
inline

Returns the value indicating whether the file is encrypted. If the file is encrypted, you need to set the password with the CZipArchive::SetPassword method before decompressing the file.

Returns
true if the file is encrypted; false otherwise.
See also
CZipArchive::SetPassword

◆ IsModified()

bool CZipFileHeader::IsModified ( ) const
inline

Returns the value indicating whether the file was modified.

Returns
true, if the file was modified; false otherwise.
See also
CZipArchive::CommitChanges

◆ IsUseUtcFileTimes()

bool CZipFileHeader::IsUseUtcFileTimes ( ) const
inline

Returns the value indicating whether UTC time is used when storing file times in an archive. When CZipArchive object created the header, it sets this flag according to its own settings (CZipArchive::IsUseUtcFileTimes).

Returns
true, if UTC time is used; false otherwise.

◆ IsWinZipAesEncryption()

bool CZipFileHeader::IsWinZipAesEncryption ( ) const
inline

Returns the value indicating whether the file is encrypted using WinZip AES encryption method.

Returns
true, if the file is encrypted using WinZip AES encryption method; false otherwise.

◆ NeedsDataDescriptor()

bool CZipFileHeader::NeedsDataDescriptor ( ) const
protected

Returns the value indicating whether the file needs the data descriptor. The data descriptor is needed when a file is encrypted or the Zip64 format needs to be used.

Returns
true, if the data descriptor is needed; false otherwise.

◆ NeedsSignatureInDataDescriptor()

bool CZipFileHeader::NeedsSignatureInDataDescriptor ( const CZipStorage * pStorage) const
inlineprotected

Returns the value indicating whether the signature in the data descriptor is needed.

Parameters
pStorageThe current storage.
Returns
true, if the signature is needed; false otherwise.

◆ operator=()

CZipFileHeader & CZipFileHeader::operator= ( const CZipFileHeader & header)

Assignment operator.

Parameters
headerThe file header to copy from.
Returns
Reference to this object.

◆ PredictCommentSize()

int CZipFileHeader::PredictCommentSize ( ) const
inline

Predicts a file comment size.

Returns
The number of characters in the comment not including a terminating NULL character.

◆ PredictFileNameSize()

int CZipFileHeader::PredictFileNameSize ( ) const
inline

Predicts the filename size after conversion using the current filename code page.

Returns
The number of characters not including a terminating NULL character.

◆ PrepareData()

void CZipFileHeader::PrepareData ( int iLevel,
bool bSegm )
protected

Prepares the data for writing when adding a new file. When Zip64 extensions are required for this file, this method adds Zip64 extra data to m_aLocalExtraData.

Parameters
iLevelThe compression level. Use numeric values here, not CZipCompressor::CompressionLevel values.
bSegmSet to true, if the archive is segmented; false otherwise.

◆ PrepareStringBuffers()

void CZipFileHeader::PrepareStringBuffers ( )
inlineprotected

Prepares the filename for writing to the archive.

◆ Read()

bool CZipFileHeader::Read ( bool bReadSignature)
protected

Reads the central file header from pStorage and validates the read data.

Parameters
bReadSignaturetrue, if the the central header signature should be read; false otherwise.
Returns
true, if the read data is consistent; false otherwise.

◆ ReadLocal()

bool CZipFileHeader::ReadLocal ( CZipCentralDir * pCentralDir)
protected

Reads the local file header from the archive and validates the read data.

Parameters
pCentralDirUsed when the archive was opened with CZipArchive::OpenFrom method. Points to the original central directory.
Returns
true, if the data read is consistent; false otherwise.
See also
CZipArchive::SetIgnoredConsistencyChecks

◆ SetComment()

bool CZipFileHeader::SetComment ( LPCTSTR lpszComment)

Sets the file comment.

Parameters
lpszCommentThe file comment.
Returns
true, if the method succeeded; false, if the current state of the archive is invalid for this method to be called.
See also
Modification of Archives: Replacing, Renaming, Deleting and Changing Data
GetComment

◆ SetCreationTime()

void CZipFileHeader::SetCreationTime ( const time_t & ttime)

Sets the file creation time. The time will be stored in a dedicated extra header.

Parameters
ttimeThe local time to set.
See also
GetCreationTime
SetModificationTime
Modification of Archives: Replacing, Renaming, Deleting and Changing Data

◆ SetFileName()

bool CZipFileHeader::SetFileName ( LPCTSTR lpszFileName,
bool bInCentralOnly = false )

Sets the filename.

The actual renaming of the file inside of the archive depends on the current commit mode.

Parameters
lpszFileNameThe filename to set.
bInCentralOnlyIf set to true, rename the file in the central directory only. The local header will not be changed. This way a file can be renamed quicker and safer. Most of the software usually doesn't pay an attention to the information in the local header. However, 7-zip validation will fail if the local header filename is not the same as in the central directory and the archive was created with ZipCompatibility::zcWindows compatibility. The solution is to set the archive compatibility to ZipCompatibility::zcUnix when creating such archives under Windows.
Returns
true, if the method succeeded; false, if the current state of the archive is invalid for this method to be called.
Note
This is taking the current Unicode mode of the archive into account even if the mode was different at the fime of creating the archive. Leading path separators are removed from the filename unless the header is a directory and the filename contains of only one path separator (indicating a root path).
See also
Modification of Archives: Replacing, Renaming, Deleting and Changing Data
GetFileName
GetFileTitle
GetFileExtension
CZipArchive::CommitChanges
CZipArchive::SetUnicodeMode

◆ SetLastAccessTime()

void CZipFileHeader::SetLastAccessTime ( const time_t & ttime)

Sets the file last access time. The time will be stored in a dedicated extra header.

Parameters
ttimeThe local time to set.
See also
GetLastAccessTime
SetModificationTime
IsUseUtcFileTimes
SetUseTimesInUtc
Modification of Archives: Replacing, Renaming, Deleting and Changing Data

◆ SetModificationTime()

void CZipFileHeader::SetModificationTime ( const time_t & ttime,
bool bFullResolution = false )

Sets the file modification time.

Parameters
ttimeThe local time to set.
bFullResolutionIf true, file time will be additionally stored as 64-bit Windows file time in a dedicated extra header. Regular PKZIP format will be preserved allowing proper extraction of the archive by software that do not support this extension. If false, the extra header will not be used and creation and last access time will be cleared.
See also
CZipArchive::SetFullFileTimes
GetModificationTime
IsUseUtcFileTimes
SetUseTimesInUtc
Modification of Archives: Replacing, Renaming, Deleting and Changing Data

◆ SetSystemAttr()

bool CZipFileHeader::SetSystemAttr ( DWORD uAttr)

Sets the file attributes.

Parameters
uAttrThe attributes to set. The high-word should no be set in attributes, it will be overwritten by Unix attributes, which are stored in high-word.
Note
Throws an exception, if the archive system or the current system is not supported by the ZipArchive Library.
See also
GetSystemAttr

◆ SetSystemCompatibility()

void CZipFileHeader::SetSystemCompatibility ( int iSystemID,
bool bUpdateAttr = false )
inlineprotected

Sets the file system compatibility.

Parameters
iSystemIDThe file system compatibility. It can be one of the ZipCompatibility::ZipPlatforms values.
bUpdateAttrIf true, the attributes will be converted to the new system; false otherwise.
See also
GetSystemCompatibility

◆ UpdateFlag()

void CZipFileHeader::UpdateFlag ( bool bSegm)
inlineprotected

Updates the general purpose bit flag.

Parameters
bSegmtrue, if the current archive is a segmented archive; false otherwise.

◆ UpdateLocalHeader()

void CZipFileHeader::UpdateLocalHeader ( CZipStorage * pStorage)
protected

Updates the local header in the archive after is has already been written.

Parameters
pStorageThe storage to update the data descriptor in.

◆ UpdateLocalZip64()

void CZipFileHeader::UpdateLocalZip64 ( bool bAdjustLocalComprSize)
protected

Creates Zip64 extra data in the local extra field, if needed.

Parameters
bAdjustLocalComprSizetrue, if the local compressed size needs to be adjusted; false otherwise.

◆ VerifySignature()

bool CZipFileHeader::VerifySignature ( CZipAutoBuffer & buf)
inlinestaticprotected

Verifies the central header signature.

Parameters
bufThe buffer that contains the signature to verify.
Returns
true, if the signature is valid; false otherwise.

◆ Write()

DWORD CZipFileHeader::Write ( CZipCentralDir * pCentralDir)
protected

Writes the central file header to pStorage.

Parameters
pCentralDirThe central directory the header belongs to.
Returns
The size of the file header.

◆ WriteCrc32()

void CZipFileHeader::WriteCrc32 ( char * pBuf) const
protected

Writes the Crc32 to pBuf.

Parameters
pBufThe buffer to write the Crc32 to. Must have be of at least 4 bytes size.

◆ WriteDataDescriptor()

void CZipFileHeader::WriteDataDescriptor ( CZipStorage * pStorage)
protected

Writes the data descriptor taking into account the Zip64 format.

Parameters
pStorageThe storage to write the data descriptor to.

◆ WriteLocal()

void CZipFileHeader::WriteLocal ( CZipStorage * pStorage)
protected

Writes the local file header to the pStorage. The filename and extra field are the same as those that will be stored in the central directory.

Parameters
pStorageThe storage to write the local file header to.

◆ WriteSmallDataDescriptor()

void CZipFileHeader::WriteSmallDataDescriptor ( char * pDest,
bool bLocal = true )
protected

Writes the data descriptor.

Parameters
pDestThe buffer to receive the data.
bLocalSet to true, if the local sizes are used; false otherwise.

Member Data Documentation

◆ m_aCentralExtraData

CZipExtraField CZipFileHeader::m_aCentralExtraData

The central extra field.

◆ m_aLocalExtraData

CZipExtraField CZipFileHeader::m_aLocalExtraData

The local extra field. Do not modify it after you started compressing the file.

◆ m_bIgnoreCrc32

bool CZipFileHeader::m_bIgnoreCrc32
protected

The value indicating whether to ignore Crc32 checking.

◆ m_gszLocalSignature

char CZipFileHeader::m_gszLocalSignature[]
static

The local file header signature.

◆ m_gszSignature

char CZipFileHeader::m_gszSignature[]
static

The central file header signature.

◆ m_pCentralDir

CZipCentralDir* CZipFileHeader::m_pCentralDir
protected

The parent central directory. It can be NULL when the header is not a part of central directory.

◆ m_tCreationTime

time_t CZipFileHeader::m_tCreationTime
protected

The file creation time (stored in the NTFS extra field).

◆ m_tLastAccessTime

time_t CZipFileHeader::m_tLastAccessTime
protected

The file last access time (stored in the NTFS extra field).

◆ m_tModificationTime

time_t CZipFileHeader::m_tModificationTime
protected

The file modification time (stored in the NTFS extra field).

◆ m_uComprSize

ZIP_SIZE_TYPE CZipFileHeader::m_uComprSize

The compressed size.

◆ m_uCrc32

DWORD CZipFileHeader::m_uCrc32

The crc-32 value.

◆ m_uEncryptionMethod

BYTE CZipFileHeader::m_uEncryptionMethod
protected

The file encryption method. It can be one of the CZipCryptograph::EncryptionMethod values.

◆ m_uExternalAttr

DWORD CZipFileHeader::m_uExternalAttr
protected

External file attributes.

◆ m_uFlag

WORD CZipFileHeader::m_uFlag

A general purpose bit flag.

◆ m_uInternalAttr

WORD CZipFileHeader::m_uInternalAttr

Internal file attributes.

◆ m_uLocalComprSize

ZIP_SIZE_TYPE CZipFileHeader::m_uLocalComprSize

The compressed size written in the local header.

◆ m_uLocalFileNameSize

WORD CZipFileHeader::m_uLocalFileNameSize
protected

The local filename length.

◆ m_uLocalHeaderSize

DWORD CZipFileHeader::m_uLocalHeaderSize
protected

The size of the local file header in bytes.

◆ m_uLocalUncomprSize

ZIP_SIZE_TYPE CZipFileHeader::m_uLocalUncomprSize

The uncompressed size written in the local header.

◆ m_uMethod

WORD CZipFileHeader::m_uMethod

The compression method. It can be one of the CZipCompressor::CompressionMethod values.

◆ m_uModDate

WORD CZipFileHeader::m_uModDate

The file last modification date. Don't set directly, but rather use CZipFileHeader::SetModificationTime method.

◆ m_uModTime

WORD CZipFileHeader::m_uModTime

The file last modification time. Don't set directly, but rather use CZipFileHeader::SetModificationTime method.

◆ m_uOffset

ZIP_SIZE_TYPE CZipFileHeader::m_uOffset

Relative offset of the local header with respect to CZipFileHeader::m_uVolumeStart.

◆ m_uUncomprSize

ZIP_SIZE_TYPE CZipFileHeader::m_uUncomprSize

The uncompressed size.

◆ m_uVersionMadeBy

unsigned char CZipFileHeader::m_uVersionMadeBy

The version of the software that created the archive.

◆ m_uVersionNeeded

WORD CZipFileHeader::m_uVersionNeeded

The version needed to extract the file.

◆ m_uVolumeStart

ZIP_VOLUME_TYPE CZipFileHeader::m_uVolumeStart

The volume number at which the compressed file starts.


The documentation for this class was generated from the following file:
Back To Top Up