#include <ZipCentralDir.h>
|
CZipFileHeader * | AddNewFile (const CZipFileHeader &header, ZIP_INDEX_TYPE uReplaceIndex, int iLevel, bool bRichHeaderTemplateCopy=false) |
|
void | Close () |
|
void | CloseFile (bool skipCheckingDataDescriptor=false) |
|
void | CloseNewFile () |
|
void | EnableFindFast (bool bEnable, bool bCaseSensitive) |
|
ZIP_INDEX_TYPE | FindFile (LPCTSTR lpszFileName, bool bCaseSensitive, bool bSporadically, bool bFileNameOnly) |
|
ZIP_INDEX_TYPE | FindFileNameIndex (LPCTSTR lpszFileName) const |
|
CZipArchive * | GetArchive () |
|
void | GetComment (CZipString &szComment) const |
|
ZIP_ARRAY_SIZE_TYPE | GetCount () const |
|
ZIP_INDEX_TYPE | GetFindFastIndex (ZIP_INDEX_TYPE uFindFastIndex) const |
|
void | GetInfo (CInfo &info) const |
|
ZIP_INDEX_TYPE | GetLastIndexAdded () const |
|
ZIP_SIZE_TYPE | GetSize (bool bWhole=false) const |
|
CZipStorage * | GetStorage () |
|
const CZipStringStoreSettings & | GetStringStoreSettings () const |
|
int | GetUnicodeMode () const |
|
void | Init (CZipCentralDir *pSource=NULL) |
|
void | InitOnCreate (CZipArchive *pArchive) |
|
bool | IsAnyFileModified () const |
|
bool | IsConsistencyCheckOn (int iLevel) |
|
bool | IsFindFastEnabled () |
|
bool | IsValidIndex (ZIP_INDEX_TYPE uIndex) const |
|
ZIP_FILE_USIZE | LocateSignature () |
|
bool | OnFileCentralChange () |
|
bool | OnFileNameChange (CZipFileHeader *pHeader, bool bInCentralOnly) |
|
void | OpenFile (ZIP_INDEX_TYPE uIndex) |
|
CZipFileHeader * | operator[] (ZIP_INDEX_TYPE uIndex) |
|
const CZipFileHeader * | operator[] (ZIP_INDEX_TYPE uIndex) const |
|
void | Read () |
|
void | RebuildFindFastArray () |
|
void | RemoveAll () |
|
void | RemoveFile (CZipFileHeader *pHeader, ZIP_INDEX_TYPE uIndex=ZIP_FILE_INDEX_UNSPECIFIED, bool bShift=true) |
|
void | RemoveFromDisk () |
|
void | RemoveLastFile (CZipFileHeader *pHeader=NULL, ZIP_INDEX_TYPE uIndex=ZIP_FILE_INDEX_UNSPECIFIED) |
|
void | SetComment (LPCTSTR lpszComment, UINT codePage) |
|
void | SetUnicodeMode (int iMode) |
|
void | ThrowError (int err) const |
|
void | Write () |
|
|
static int | CompareFindFastCollate (const void *pArg1, const void *pArg2) |
|
static int | CompareFindFastCollateNoCase (const void *pArg1, const void *pArg2) |
|
static int | CompareHeaders (const void *pArg1, const void *pArg2) |
|
Represents the central directory record in an archive.
Definition at line 48 of file ZipCentralDir.h.
CZipFileHeader* CZipCentralDir::AddNewFile |
( |
const CZipFileHeader & |
header, |
|
|
ZIP_INDEX_TYPE |
uReplaceIndex, |
|
|
int |
iLevel, |
|
|
bool |
bRichHeaderTemplateCopy = false |
|
) |
| |
Adds a new file to the central directory.
- Parameters
-
header | Used as a template for the data stored inside the archive. |
uReplaceIndex | The index of the file to be replaced or ZIP_FILE_INDEX_UNSPECIFIED , if the index is unknown. |
iLevel | The compression level. |
bRichHeaderTemplateCopy | true , if copy crc and sizes values from header; false otherwise. |
- Returns
- The new header.
void CZipCentralDir::BuildFindFastArray |
( |
bool |
bCaseSensitive | ) |
|
|
protected |
void CZipCentralDir::Close |
( |
| ) |
|
Closes the central directory.
void CZipCentralDir::CloseFile |
( |
bool |
skipCheckingDataDescriptor = false | ) |
|
Closes a file opened for reading inside the archive.
- Parameters
-
skipCheckingDataDescriptor | If true , the data descriptor that is located after the compressed data in the archive is checked for validity. Set this value to false after closing the file after an exception was thrown. |
void CZipCentralDir::CloseNewFile |
( |
| ) |
|
Closes a file opened for reading inside the archive.
int CZipCentralDir::CompareElement |
( |
LPCTSTR |
lpszFileName, |
|
|
ZIP_INDEX_TYPE |
uIndex |
|
) |
| const |
|
inlineprotected |
The method used in comparison involving the Find Fast feature.
- Parameters
-
- Returns
- The return value has the following meaning:
- 0 if the filenames are the same
- < 0 if the filename stored in the array is less than lpszFileName
- > 0 if the filename stored in the array is greater than lpszFileName
Definition at line 721 of file ZipCentralDir.h.
static int CZipCentralDir::CompareHeaders |
( |
const void * |
pArg1, |
|
|
const void * |
pArg2 |
|
) |
| |
|
inlinestaticprotected |
The method used in comparison when sorting headers.
Definition at line 628 of file ZipCentralDir.h.
void CZipCentralDir::CreateSharedData |
( |
| ) |
|
|
protected |
Creates data that can be shared between different archive objects.
- See Also
- DestroySharedData
void CZipCentralDir::DestroySharedData |
( |
| ) |
|
|
protected |
Destroys data shared between different archive objects, if the usage reference count of the data is zero.
- See Also
- CreateSharedData
void CZipCentralDir::EnableFindFast |
( |
bool |
bEnable, |
|
|
bool |
bCaseSensitive |
|
) |
| |
ZIP_INDEX_TYPE CZipCentralDir::FindFile |
( |
LPCTSTR |
lpszFileName, |
|
|
bool |
bCaseSensitive, |
|
|
bool |
bSporadically, |
|
|
bool |
bFileNameOnly |
|
) |
| |
ZIP_INDEX_TYPE CZipCentralDir::FindFileNameIndex |
( |
LPCTSTR |
lpszFileName | ) |
const |
void CZipCentralDir::GetComment |
( |
CZipString & |
szComment | ) |
const |
ZIP_ARRAY_SIZE_TYPE CZipCentralDir::GetCount |
( |
| ) |
const |
|
inline |
Returns the number of files in the archive.
- Returns
- The number of files in the archive.
Definition at line 432 of file ZipCentralDir.h.
ZIP_INDEX_TYPE CZipCentralDir::GetFindFastIndex |
( |
ZIP_INDEX_TYPE |
uFindFastIndex | ) |
const |
|
inline |
void CZipCentralDir::GetInfo |
( |
CInfo & |
info | ) |
const |
|
inline |
ZIP_INDEX_TYPE CZipCentralDir::GetLastIndexAdded |
( |
| ) |
const |
|
inline |
Returns the index of the recently added file (if any).
- Returns
- The index of the recently added file or
ZIP_FILE_INDEX_UNSPECIFIED
if the index is unknown.
Definition at line 325 of file ZipCentralDir.h.
ZIP_SIZE_TYPE CZipCentralDir::GetSize |
( |
bool |
bWhole = false | ) |
const |
Returns the central directory size.
- Parameters
-
bWhole | If true , include the size of the file headers. If false , the size of the file headers is not included. |
- Returns
- The size of the central directory.
- See Also
- CZipArchive::GetCentralDirSize
Returns the current storage.
- Returns
- The current storage.
Definition at line 535 of file ZipCentralDir.h.
int CZipCentralDir::GetUnicodeMode |
( |
| ) |
const |
|
inline |
Initializes the object.
- Parameters
-
pSource | If not NULL , it specifies the central directory for sharing. |
void CZipCentralDir::InitOnCreate |
( |
CZipArchive * |
pArchive | ) |
|
Initializes the central directory during construction.
- Parameters
-
pArchive | The archive that creates the object. |
ZIP_INDEX_TYPE CZipCentralDir::InsertFindFastElement |
( |
CZipFileHeader * |
pHeader, |
|
|
ZIP_INDEX_TYPE |
uIndex |
|
) |
| |
|
protected |
bool CZipCentralDir::IsAnyFileModified |
( |
| ) |
const |
Examines whether any file is modified.
- Returns
true
, if there are modified files; false
otherwise.
- See Also
- CZipArchive::IsModified
bool CZipCentralDir::IsConsistencyCheckOn |
( |
int |
iLevel | ) |
|
|
inline |
Returns the value indicating whether the specified consistency check should be performed.
- Parameters
-
- Returns
true
, if the specified check should be performed; false
otherwise.
- See Also
- m_iIgnoredChecks
Definition at line 523 of file ZipCentralDir.h.
bool CZipCentralDir::IsFindFastEnabled |
( |
| ) |
|
|
inline |
Returns the value indicating whether the Find Fast feature is enabled.
- Returns
- The value of CInfo::m_bFindFastEnabled.
Definition at line 484 of file ZipCentralDir.h.
bool CZipCentralDir::IsValidIndex |
( |
ZIP_INDEX_TYPE |
uIndex | ) |
const |
Tests if the given file index is valid.
- Parameters
-
uIndex | A zero-based index to test. |
- Returns
true
, if the file with the given index exists inside the archive; false
otherwise.
bool CZipCentralDir::OnFileCentralChange |
( |
| ) |
|
Called when data of a file changes in a central directory file header.
- Returns
true
, if the change is permitted; false
otherwise.
bool CZipCentralDir::OnFileNameChange |
( |
CZipFileHeader * |
pHeader, |
|
|
bool |
bInCentralOnly |
|
) |
| |
Called when a filename of a file in the archive changes.
- Returns
true
, if the change is permitted; false
otherwise.
void CZipCentralDir::OpenFile |
( |
ZIP_INDEX_TYPE |
uIndex | ) |
|
Opens the file with the given index.
- Parameters
-
uIndex | A zero-based index of the file to open. |
const CZipFileHeader* CZipCentralDir::operator[] |
( |
ZIP_INDEX_TYPE |
uIndex | ) |
const |
|
inline |
void CZipCentralDir::Read |
( |
| ) |
|
Reads the central directory from the archive.
void CZipCentralDir::ReadHeaders |
( |
| ) |
|
|
protected |
Reads file headers from the archive.
void CZipCentralDir::RebuildFindFastArray |
( |
| ) |
|
|
inline |
void CZipCentralDir::RemoveAll |
( |
| ) |
|
bool CZipCentralDir::RemoveDataDescr |
( |
bool |
bFromBuffer | ) |
|
|
protected |
Removes data descriptors from a segmented archive that turned out to be single-segment only. It is not called for encrypted files.
- Parameters
-
bFromBuffer | If true , removes the descriptors from the write buffer in memory otherwise from the file on the disk. |
- Returns
false
, if the file mapping to memory was not successful (can happen only when bFromBuffer is false
); true
otherwise.
void CZipCentralDir::RemoveFile |
( |
CZipFileHeader * |
pHeader, |
|
|
ZIP_INDEX_TYPE |
uIndex = ZIP_FILE_INDEX_UNSPECIFIED , |
|
|
bool |
bShift = true |
|
) |
| |
Removes a file header from the central directory.
- Parameters
-
pHeader | The header to remove. |
uIndex | The index of the header to remove. Use ZIP_FILE_INDEX_UNSPECIFIED , if the index is unknown. |
bShift | If true , the data inside the archive is moved over the hole created after removing the file. If false , the unused area inside the archive remains. |
ZIP_INDEX_TYPE CZipCentralDir::RemoveFindFastElement |
( |
CZipFileHeader * |
pHeader, |
|
|
bool |
bShift |
|
) |
| |
|
protected |
Removes a CZipFindFast element from the CZipCentralDir::m_pFindArray array.
- Parameters
-
pHeader | The element associated with this object will be removed. |
bShift | If true , the affected indexes will be shifted; false otherwise. |
void CZipCentralDir::RemoveFromDisk |
( |
| ) |
|
Removes physically the central directory from the archive.
void CZipCentralDir::RemoveHeaders |
( |
| ) |
|
|
protected |
void CZipCentralDir::RemoveLastFile |
( |
CZipFileHeader * |
pHeader = NULL , |
|
|
ZIP_INDEX_TYPE |
uIndex = ZIP_FILE_INDEX_UNSPECIFIED |
|
) |
| |
Removes last file from the central directory.
- Parameters
-
pHeader | The header to remove. |
uIndex | The index of the header to remove. Use ZIP_FILE_INDEX_UNSPECIFIED , if the index is unknown. |
void CZipCentralDir::SetComment |
( |
LPCTSTR |
lpszComment, |
|
|
UINT |
codePage |
|
) |
| |
void CZipCentralDir::SetUnicodeMode |
( |
int |
iMode | ) |
|
|
inline |
void CZipCentralDir::ThrowError |
( |
int |
err | ) |
const |
Throws an exception with the given code.
void CZipCentralDir::Write |
( |
| ) |
|
Writes the central directory to the archive.
void CZipCentralDir::WriteCentralEnd |
( |
| ) |
|
|
protected |
Writes the End of Central Directory Record.
- Returns
- The size of the record.
void CZipCentralDir::WriteHeaders |
( |
bool |
bOneDisk | ) |
|
|
protected |
Writes the file headers to the archive.
char CZipCentralDir::m_gszSignature[] |
|
static |
The End of Central Directory Record signature.
Definition at line 210 of file ZipCentralDir.h.
char CZipCentralDir::m_gszSignature64Locator[] |
|
static |
The Zip64 End of Central Directory Locator signature.
Definition at line 211 of file ZipCentralDir.h.
int CZipCentralDir::m_iIgnoredChecks |
int CZipCentralDir::m_iUnicodeMode |
|
protected |
CInfo* CZipCentralDir::m_pInfo |
|
protected |
It points to the currently opened file or it is NULL
, if no file is opened.
Definition at line 212 of file ZipCentralDir.h.
The documentation for this class was generated from the following file: