#include <ZipCentralDir.h>
Public Member Functions | |
void | Init () |
Called by CZipArchive::OpenInternal. | |
void | Read () |
Read the central directory from the archive. | |
void | OpenFile (WORD uIndex) |
Open the file. | |
CZipFileHeader * | UpdateLocal (WORD uIndex) |
Update local header info. | |
bool | IsValidIndex (int uIndex) const |
Test if the given file header index is valid. | |
void | RemoveFile (CZipFileHeader *pHeader, int iIndex=-1, bool bShift=true) |
Remove the file header from the central directory. | |
void | RemoveLastFile (CZipFileHeader *pHeader=NULL, int iIndex=-1) |
Remove last file from the central directory. | |
void | RemoveAll () |
Remove all files. | |
void | Clear (bool bEverything=true) |
Cleanup the structure. | |
CZipFileHeader * | AddNewFile (const CZipFileHeader &header, int iReplaceIndex=-1) |
Add a new file to the central directory. | |
CZipString | GetProperHeaderFileName (const CZipFileHeader *pHeader) const |
return the header filename, converted if needed | |
void | RemoveFromDisk () |
Remove physically the central directory from the archive. | |
DWORD | GetSize (bool bWhole=false) const |
Get the central directory size. | |
void | CloseFile (bool bAfterException=false) |
Close a file inside archive opened for reading. | |
void | CloseNewFile () |
Close a file inside archive opened for reading. | |
void | Write (CZipActionCallback *pCallback) |
Write the central directory to the archive. | |
void | EnableFindFast (bool bEnable, bool bCaseSensitive) |
int | FindFile (LPCTSTR lpszFileName, bool bCaseSensitive, bool bSporadically, bool bFileNameOnly) |
int | GetFindFastIndex (int iFindFastIndex) const |
CZipFileHeader * | operator[] (int iIndex) |
const CZipFileHeader * | operator[] (int iIndex) const |
void | ConvertFileName (bool bFromZip, bool bAfterOpen, CZipFileHeader *pHeader=NULL) const |
Convert the filename of the CZipFileHeader depending on the current system and the system the zip file was created on (change slash to backslash or vice versa, perform ANSI-OEM conversion if necessary). | |
void | ConvertAll () |
Convert all the filenames to the system form. | |
int | FindFileNameIndex (LPCTSTR lpszFileName) const |
DWORD | GetBytesBefore () const |
void | GetInfo (Info &info) const |
Get the information about the central directory. | |
bool | IsFindFastEnabled () |
void | RenameFile (WORD uIndex, LPCTSTR lpszNewName) |
Called by CZipArchive::RenameFile. | |
Public Attributes | |
char | m_szSignature [4] |
end of central dir signature (must be 0x06054b50) | |
CZipAutoBuffer | m_pszComment |
the archive comment | |
CZipAutoBuffer | m_pLocalExtraField |
a local extra field | |
CZipFileHeader * | m_pOpenedFile |
points to a currently opened file or NULL if no file is opened | |
CZipStorage * | m_pStorage |
Points to CZipArchive::m_storage. | |
int | m_iBufferSize |
The size of the buffer used in searching for the central dir. | |
CZipArray< CZipFileHeader * > | m_headers |
Holds all the files inside archive info. | |
bool | m_bConvertAfterOpen |
| |
bool | m_bOemConversion |
If true , the OEM conversion is performed under Windows platform on the filenames of the files inside an archive (there is the Ansi-to-Oem conversion performed when storing the filename in the archive, and Oem-to-Ansi when reading the filename from the archive). | |
Static Public Attributes | |
static char | m_gszSignature [] |
central dir signature | |
Protected Member Functions | |
void | SortHeaders () |
Sort the files inside the archive headers by the order in the archive. | |
void | BuildFindFastArray (bool bCaseSensitive) |
Build m_findarray. | |
int | CompareElement (LPCTSTR lpszFileName, WORD uIndex) const |
The lpszFileName and bCaseSensitive arguments are the same as in the FindFileNameIndex. | |
void | InsertFindFastElement (CZipFileHeader *pHeader, WORD uIndex) |
Insert a new CZipFindFast element to the m_findarray. | |
DWORD | Locate () |
void | ReadHeaders () |
Read the file headers from the file. | |
void | RemoveHeaders () |
Free the memory allocated for the CZipFileHeader structures. | |
bool | RemoveDataDescr (bool bFromBuffer) |
Remove data descriptors from the write buffer in the disk spanning volume that turned out to be one-disk only. | |
void | WriteHeaders (CZipActionCallback *pCallback, bool bOneDisk) |
Write the file headers to the archive. | |
DWORD | WriteCentralEnd () |
Write the central directory end record. | |
void | ThrowError (int err) const |
Throw an exception with the given code. | |
Static Protected Member Functions | |
static int | CompareHeaders (const void *pArg1, const void *pArg2) |
Protected Attributes | |
CZipArray< CZipFindFast > | m_findarray |
Used in fast finding files by the filename. | |
bool | m_bFindFastEnabled |
If true , the there is an additional array build, to speed up the finding process CZipArchive::FindFile uses this array to perform a binary search. | |
ZIPSTRINGCOMPARE | m_pCompare |
A compare function (Collate or CollateNoCase) set once so as not to check every time which one to use ZIPSTRINGCOMPARE is defined in CZipString.h as: typedef int (CZipString::*ZIPSTRINGCOMPARE)( LPCTSTR ) const; . | |
bool | m_bCaseSensitive |
The way the m_findarray is sorted. | |
Info | m_info |
Classes | |
struct | CZipFindFast |
Used in fast finding files by the filename. More... | |
struct | Info |
Stores general information about the central directory record. More... |
Definition at line 45 of file ZipCentralDir.h.
|
Add a new file to the central directory.
|
|
Cleanup the structure.
|
|
Close a file inside archive opened for reading.
|
|
Close a file inside archive opened for reading.
|
|
The lpszFileName and bCaseSensitive arguments are the same as in the FindFileNameIndex. The function get CZipFindFast structure pointed by uIndex and compares the filename of CZipFileHeader class stored in this structure with lpszFileName.
Definition at line 493 of file ZipCentralDir.h. References m_findarray, and m_pCompare. |
|
Convert all the filenames to the system form. Called by CZipArchive::FindFile
|
|
Convert the filename of the CZipFileHeader depending on the current system and the system the zip file was created on (change slash to backslash or vice versa, perform ANSI-OEM conversion if necessary).
Definition at line 386 of file ZipCentralDir.h. References ZipCompatibility::FileNameUpdate(), m_bConvertAfterOpen, m_bOemConversion, and m_pOpenedFile. Referenced by GetProperHeaderFileName(). |
|
|
|
|
|
|
|
Definition at line 295 of file ZipCentralDir.h. References IsValidIndex(), m_bFindFastEnabled, and m_findarray. |
|
Get the central directory size.
|
|
Insert a new CZipFindFast element to the m_findarray. Initialize CZipFindFast object with pHeader and uIndex values. |
|
Definition at line 423 of file ZipCentralDir.h. References m_bFindFastEnabled. |
|
Test if the given file header index is valid.
Referenced by GetFindFastIndex(). |
|
|
|
Open the file.
|
|
Read the central directory from the archive.
|
|
Read the file headers from the file.
|
|
Remove all files.
|
|
Remove data descriptors from the write buffer in the disk spanning volume that turned out to be one-disk only. We do not remove them from password encrypted files.
|
|
Remove the file header from the central directory.
Referenced by RemoveLastFile(). |
|
Remove physically the central directory from the archive. Called during adding or deleting files.
|
|
Throw an exception with the given code.
|
|
Update local header info.
|
|
Write the central directory to the archive.
|
|
Write the central directory end record.
|
|
Write the file headers to the archive.
|
|
Change is value with CZipArchive::SetConvertAfterOpen.
Set it to
Default:
Definition at line 357 of file ZipCentralDir.h. Referenced by ConvertFileName(), and GetProperHeaderFileName(). |
|
If
Default: Definition at line 476 of file ZipCentralDir.h. Referenced by GetFindFastIndex(), and IsFindFastEnabled(). |
|
If
Set it to
Definition at line 367 of file ZipCentralDir.h. Referenced by ConvertFileName(). |
|
Used in fast finding files by the filename.
Definition at line 464 of file ZipCentralDir.h. Referenced by CompareElement(), and GetFindFastIndex(). |
|
Holds all the files inside archive info.
Definition at line 328 of file ZipCentralDir.h. Referenced by operator[](), and RemoveLastFile(). |
|
The size of the buffer used in searching for the central dir. Set before opening the archive. It is usually set with CZipArchive::SetAdvanced (specify this value as the third argument).
Definition at line 319 of file ZipCentralDir.h. |
|
Definition at line 521 of file ZipCentralDir.h. Referenced by GetBytesBefore(), GetInfo(), and RemoveLastFile(). |