#include <ZipArchive.h>
Public Types | |
enum | CallbackType { cbNothing = 0x0000, cbAdd = 0x0001, cbAddTmp = 0x0002, cbAddStore = 0x0004, cbExtract = 0x0008, cbDeleteCnt = 0x0010, cbDelete = 0x0020, cbTest = 0x0040, cbSave = 0x0080, cbGetFromArchive = 0x0100, cbRename = 0x0200, cbReplace = 0x0400, cbNextValue = 0x0800, cbSubActions = cbAddTmp | cbAddStore | cbDeleteCnt | cbReplace, cbActions = cbAdd | cbExtract | cbDelete | cbTest | cbSave | cbGetFromArchive | cbRename, cbAll = cbActions | cbSubActions } |
Enum values used as iWhich parameter in SetCallback function. More... | |
enum | OpenMode { zipOpen, zipOpenReadOnly, zipCreate, zipCreateSpan } |
Archive open modes used in Open(LPCTSTR , int , int ) and Open(CZipAbstractFile&, int ) . More... | |
enum | Smartness { zipsmLazy = 0x0000, zipsmCPassDir = 0x0001, zipsmCPFile0 = 0x0002, zipsmNotCompSmall = 0x0004, zipsmCheckForEff = 0x0008, zipsmMemoryFlag = 0x0010, zipsmCheckForEffInMem = zipsmMemoryFlag | zipsmCheckForEff, zipsmSmartPass = zipsmCPassDir | zipsmCPFile0, zipsmSmartAdd = zipsmNotCompSmall | zipsmCheckForEff, zipsmSafeSmart = zipsmSmartPass | zipsmNotCompSmall, zipsmSmartest = zipsmSmartPass | zipsmSmartAdd, zipsmInternal01 = 0xf000 } |
The levels of smartness of the adding files action (see AddNewFile). More... | |
enum | FFCaseSens { ffDefault, ffCaseSens, ffNoCaseSens } |
case-sensitivity values used as argument iCaseSensitive in FindFile More... | |
enum | CloseAfterException { afNoException, afAfterException, afWriteDir } |
values used in Close function as parameter iAfterException More... | |
enum | Predict { prDir, prFile, prAuto } |
enum values used in PredictFileNameInZip More... | |
Public Member Functions | |
bool | SetPassword (LPCTSTR lpszPassword=NULL) |
Set the password for the file to be opened or created. | |
CZipString | GetPassword () const |
void | SetAdvanced (int iWriteBuffer=65536, int iGeneralBuffer=65536, int iSearchBuffer=32768) |
Set the buffer sizes. | |
void | GetAdvanced (int *piWriteBuffer=NULL, int *piGeneralBuffer=NULL, int *piSearchBuffer=NULL) |
retreive buffer size as set by SetAdvanced | |
void | SetCallback (CZipActionCallback *pCallback=NULL, int iWhich=cbAll) |
Set callback objects for the following operations on the zip archive: adding, extracting, testing or deleting files. | |
CZipActionCallback * | GetCallback (CallbackType iWhich) |
void | SetSpanCallback (CZipSpanCallback *pCallback=NULL) |
Set the callback object used during operations on a PKZIP compatible disk spanning archive to change disks. | |
void | Open (LPCTSTR szPathName, int iMode=zipOpen, int iVolumeSize=0) |
Open or create a zip archive. | |
void | Open (CZipAbstractFile &af, int iMode=zipOpen) |
Open or create the archive in memory. | |
void | SetRootPath (LPCTSTR szPath=NULL) |
Set m_szRootPath to a specified value. | |
CZipString | GetRootPath () const |
Return the current value of m_szRootPath. | |
bool | AddNewFile (CZipAddNewFileInfo &info) |
Add a new file to the archive. | |
bool | AddNewFile (LPCTSTR lpszFilePath, int iComprLevel=-1, bool bFullPath=true, int iSmartLevel=zipsmSafeSmart, unsigned long nBufSize=65536) |
bool | AddNewFile (LPCTSTR lpszFilePath, LPCTSTR lpszFileNameInZip, int iComprLevel=-1, int iSmartLevel=zipsmSafeSmart, unsigned long nBufSize=65536) |
bool | AddNewFile (CZipMemFile &mf, LPCTSTR lpszFileNameInZip, int iComprLevel=-1, int iSmartLevel=zipsmSafeSmart, unsigned long nBufSize=65536) |
bool | OpenNewFile (CZipFileHeader &header, int iLevel=Z_DEFAULT_COMPRESSION, LPCTSTR lpszFilePath=NULL, DWORD uInternal=0) |
Add a new file to the opened zip archive. | |
bool | WriteNewFile (const void *pBuf, DWORD iSize) |
Compress the contents of the buffer and write it to a new file. | |
void | SetExtraField (const char *pBuf, WORD iSize) |
Set the extra field in the central directory of the currently opened file. | |
bool | CloseNewFile (bool bAfterException=false) |
Close the new file in the archive. | |
bool | GetFromArchive (CZipArchive &zip, WORD uIndex, int iReplaceIndex=-1, bool bKeepSystComp=false) |
Acquire a file with the given index from another archive. | |
bool | GetFromArchive (CZipArchive &zip, CZipWordArray &aIndexes, bool bKeepSystComp=false) |
Acquire files with the given indexes from another archive. | |
bool | GetFromArchive (CZipArchive &zip, CZipStringArray &aNames, bool bKeepSystComp=false) |
Acquire files with the given indexes from another archive. | |
void | GetIndexes (const CZipStringArray &aNames, CZipWordArray &aIndexes) |
Get indexes of the files stored int aNames array and put them into aIndexes. | |
bool | ExtractFile (WORD uIndex, LPCTSTR lpszPath, bool bFullPath=true, LPCTSTR lpszNewName=NULL, DWORD nBufSize=65536) |
Extract the file from the archive. | |
bool | ExtractFile (WORD uIndex, CZipMemFile &mf, bool bRewind=true, DWORD nBufSize=65536) |
The same as ExtractFile(WORD , LPCTSTR , bool , LPCTSTR , DWORD ) but instead to a physical file, this function decompress the data into CZipMemFile object. | |
bool | OpenFile (WORD uIndex) |
Open the file with the given index in the archive for extracting. | |
DWORD | ReadFile (void *pBuf, DWORD iSize) |
Decompress currently opened file to the buffer. | |
bool | TestFile (WORD uIndex, DWORD uBufSize=65536) |
Test the file with the given index for the integrity. | |
void | CloseFileWithNoUpdate () |
Perform the necessary cleanup after an exception was thrown while testing or extracting the archive so that next files in the archive can be tested or extracted. | |
int | GetLocalExtraField (char *pBuf, int iSize) const |
Get the local extra filed of the currently opened for extraction file in the archive. | |
int | CloseFile (CZipFile &file) |
The same as CZipArchive::CloseFile(LPCTSTR), but additionally closes file. | |
int | CloseFile (LPCTSTR lpszFilePath=NULL, bool bAfterException=false) |
Close the file opened for extraction in the archive and copy its date and attributes to the file pointed by lpszFilePath. | |
void | DeleteFile (WORD uIndex) |
Delete the file from the archive with the given index. | |
void | DeleteFiles (CZipWordArray &aIndexes) |
Delete files from the archive. | |
void | DeleteFiles (const CZipStringArray &aNames) |
Delete files from the archive. | |
bool | SetGlobalComment (LPCTSTR lpszComment) |
Set the global comment in the archive. | |
CZipString | GetGlobalComment () const |
bool | SetFileComment (WORD uIndex, LPCTSTR lpszComment) |
Set the comment of the file with the given index inside the archive. | |
CZipString | GetArchivePath () const |
int | GetCurrentDisk () const |
int | GetSpanMode () const |
Return the disk spanning mode of the current archive. | |
int | FindFile (LPCTSTR lpszFileName, int iCaseSensitive=ffDefault, bool bFileNameOnly=false) |
Find the file in the archive. | |
bool | GetFileInfo (CZipFileHeader &fhInfo, WORD uIndex) const |
Get the info of the file with the given index. | |
int | GetCount (bool bOnlyFiles=false) const |
DWORD | GetOccupiedSpace () const |
Calculates the actual size (in bytes) currently occupied by the archive. | |
void | Close (int iAfterException=afNoException, bool bUpdateTimeStamp=false) |
Close the archive. | |
bool | IsClosed (bool bArchive=true) const |
Test if the archive is closed (a whole or the current volume only). | |
void | Flush () |
Write the central directory to the archive and flushes the internal buffers to the disk, so that the archive is finalized on the disk, but you can still modify it. | |
void | SetAutoFlush (bool bAutoFlush=true) |
Set the CZipArchive object to call Flush after each operation that modifies the archive (adding a new file, deleting file(s), modifying the global or a file comment). | |
bool | GetAutoFlush () const |
return the current m_bAutoFlush value | |
int | GetSystemCompatibility () const |
Return the system compatibility of the current archive. | |
bool | SetSystemCompatibility (int iSystemComp) |
Set the system compatibility of the archive. | |
void | SetFileHeaderAttr (CZipFileHeader &header, DWORD uAttr) const |
Set the attributes for CZipFileHeader structure to be used in OpenNewFile method as an argument. | |
CZipStorage * | GetStorage () |
Return the underlying archive storage medium. | |
void | SetDetectZlibMemoryLeaks (bool bDetect) |
Set m_bDetectZlibMemoryLeaks value. | |
void | SetConvertAfterOpen (bool bConvertAfterOpen) |
Set CZipCentralDir::m_bConvertAfterOpen value. | |
void | EnableOemConversion (bool enable) |
Set CZipCentralDir::m_bOemConversion value. | |
void | EnableFindFast (bool bEnable=true) |
Enable fast finding by the file name of the files inside the archive. | |
int | GetFindFastIndex (int iFindFastIndex) const |
After you enable FindFast feature with EnableFindFast, you can retrieve how the files are sorted in CZipCentralDir::m_findarray (you can use it in your own program if you need to display the sorted list and do not want to duplicate data). | |
void | SetTempPath (LPCTSTR lpszPath=NULL, bool bForce=true) |
Set a temporary path used when compressing files and zipsmCheckForEff is specified as an argument in AddNewFile and the disk spanning archive is in creation. | |
CZipString | PredictFileNameInZip (LPCTSTR lpszFilePath, bool bFullPath, int iWhat=prAuto, bool bExactly=false) const |
Given the file path in the form it would be passed to AddNewFile as lpszFilePath argument, the function returns the file name as it would be stored in the archive. | |
DWORD | PredictMaximumFileSizeInArchive (CZipFileHeader &fh) const |
Calculate the maximum number of bytes that the file represented by CZipFileHeader would occupy in the current archive. | |
DWORD | PredictMaximumFileSizeInArchive (LPCTSTR lpszFilePath, bool bFullPath) const |
Calls CZipArchive::PredictMaximumFileSizeInArchive(CZipFileHeader&). | |
int | WillBeDuplicated (LPCTSTR lpszFilePath, bool bFullPath, bool bFileNameOnly=false, int iWhat=prAuto) |
Check if the filename will be duplicted in the archive, if added to the archive in the given form. | |
CZipString | PredictExtractedFileName (LPCTSTR lpszFileNameInZip, LPCTSTR lpszPath, bool bFullPath, LPCTSTR lpszNewName=NULL) const |
Predict the full filename with path after extraction. | |
CZipString | GetTempPath () const |
Return the current value of m_szTempPath. | |
CZipString | TrimRootPath (CZipPathComponent &zpc) const |
Function used in conjunction with m_szRootPath to trim paths in AddNewFile and ExtractFile. | |
void | SetCaseSensitivity (bool bCaseSensitive) |
Set the default archive case-sensitivity. | |
void | GetCentralDirInfo (CZipCentralDir::Info &info) const |
Return the central directory information. | |
DWORD | GetCentralDirSize (bool bWhole=true) const |
Get the central directory size. | |
bool | IsReadOnly () |
return true if the archive cannot be modified, because it is an existing disk spanning archive or it was opened with zipOpenReadOnly | |
void | SetIgnoreCRC (bool bIgnore=true) |
If you set bIgnore to true , CRC is not checked for the files being tested or extracted. | |
void | SetTreatAsSingleDisk (bool bSingleDisk=true) |
If you set bSingleDisk to true , no disk change will occur while reading an existing archive. | |
void | FindMatches (LPCTSTR lpszPattern, CZipWordArray &ar, bool bFullPath=true) const |
This function finds the indexes of the files, which filenames match the specified pattern and stores these indexes in the array. | |
bool | RenameFile (WORD uIndex, LPCTSTR lpszNewName) |
Change the name of the file with the given index. | |
Static Public Member Functions | |
static int | SingleToWide (const CZipAutoBuffer &szSingle, CZipString &szWide) |
In non-UNICODE version just copy szSingle to szWide. | |
static int | WideToSingle (LPCTSTR lpWide, CZipAutoBuffer &szSingle) |
In non-UNICODE version just copy lpWide to szSingle. | |
static void | WideConversionUseAnsi (bool bUseAnsi) |
Call it to change how the Unicode string conversion is handled. | |
static void | ReadBytes (void *pDestination, const char *pSource, int iCount) |
Read iCount bytes from pSource into pDestination. | |
static void | WriteBytes (char *pDestination, const void *pSource, int iCount) |
Write iCount bytes from pSource into pDestination. | |
static bool | CompareBytes (const char *pBuffer, const void *pBytes, int iCount) |
Compare iCount bytes. | |
static const DWORD * | GetCRCTable () |
A helper for a various purposes (needed e.g. | |
static bool | RemovePathBeginning (LPCTSTR lpszBeginning, CZipString &szPath, ZIPSTRINGCOMPARE pCompareFunction) |
Remove lpszBeginning from the beginning of the szPath. | |
Public Attributes | |
bool | m_bRemoveDriveLetter |
If true , the drive letter is removed from the filename stored inside the archive when adding a new file to the archive. | |
Protected Types | |
typedef CZipPtrList< void * >::iterator | CZipPtrListIter |
enum | OpenFileType { extract = -1, nothing, compress } |
The open mode of the current file inside archive. More... | |
Protected Member Functions | |
void | MakeSpaceForReplace (int iReplaceIndex, DWORD uTotal, LPCTSTR lpszFileName) |
void | WriteCentralDirectory (bool bFlush=true) |
Write central directory notifying a callback object if available. | |
void | OpenInternal (int iMode) |
Open the archive in the given mode. | |
void | EmptyPtrList () |
Free the memory allocated by the zlib library that hasn't been freed due to an error in the zlib library (usually never happens). | |
void | MovePackedFiles (DWORD uStartOffset, DWORD uEndOffset, DWORD uMoveBy, CZipActionCallback *pCallback, bool bForward=false) |
Move the range of data in the archive specified by the uStartOffset and uEndOffset by uToMove. | |
bool | RemoveLast (bool bRemoveAnyway=false) |
Remove recently added file (used by AddNewFile) if compressed is larger than uncompressed or if callback method return false . | |
bool | GetFromArchive (CZipArchive &zip, WORD uIndex, int iReplaceIndex, bool bKeepSystComp, CZipActionCallback *pCallback) |
It is used in GetFromArchive public functions and in AddNewFile and the callback parameter is needed. | |
bool | UpdateReplaceIndex (int &iReplaceIndex, LPCTSTR lpszNewFileName) |
CZipFileHeader * | CurrentFile () |
void | CheckForError (int iErr) |
If the parameter iErr signalizes a zlib library error, throw CZipException. | |
void | ThrowError (int err, bool bZlib=false) |
Throw a CZipException error. | |
void | CryptDecodeBuffer (DWORD uCount) |
Decode uCount bytes from the internal buffer. | |
void | CryptEncodeBuffer () |
Encode the internal buffer. | |
void | CryptEncode (char &c) |
Encode the character c and update encryption keys . | |
void | CryptCryptHeader (long iCrc, CZipAutoBuffer &buf) |
Create an encryption header for the new file in the archive. | |
DWORD | CryptCRC32 (DWORD l, char c) |
void | CryptDecode (char &c) |
Decode the character c and update encryption keys . | |
char | CryptDecryptByte () |
bool | CryptCheck () |
Decrypt the encryption header and check its control value. | |
void | CryptUpdateKeys (char c) |
Update encryption keys with the given value. | |
void | CryptInitKeys () |
Initialize encryption keys . | |
Static Protected Member Functions | |
static void * | _zliballoc (void *opaque, UINT items, UINT size) |
memory allocator called by the zlib library | |
static void | _zlibfree (void *opaque, void *address) |
memory deallocator called by the zlib library | |
Protected Attributes | |
CZipClbckStrg | m_callbacks |
bool | m_bCaseSensitive |
Default archive case-sensitivity. | |
ZIPSTRINGCOMPARE | m_pZipCompare |
a pointer to the function in CZipString structure, used to compare elements; can point to Compare, CompareNoCase, Collate or CollateNoCase function address in CZipString structure ZIPSTRINGCOMPARE is defined as follows: typedef int (CZipString::*ZIPSTRINGCOMPARE)( LPCTSTR ) const; | |
CZipInternalInfo | m_info |
Internal data. | |
CZipStorage | m_storage |
Physical layer of the archive. | |
CZipCentralDir | m_centralDir |
A central directory object. | |
char | m_iFileOpened |
Takes one of the OpenFileType enum values. | |
bool | m_bAutoFlush |
The current AutoFlush value. | |
bool | m_bIgnoreCRC |
The value set with SetIgnoreCRC. | |
CZipString | m_szRootPath |
The root path to be omitted in AddNewFile and ExtractFile functions from the beginning of the full file path. | |
CZipString | m_szTempPath |
A temporary path set with SetTempPath function. | |
int | m_iArchiveSystCompatib |
The system code of the current archive. | |
CZipPtrList< void * > | m_list |
a list holding pointers to the memory areas allocated by the zlib library | |
bool | m_bDetectZlibMemoryLeaks |
Specify whether to control memory allocation and freeing by the zlib library. | |
CZipAutoBuffer | m_pszPassword |
The archive password. | |
DWORD | m_keys [3] |
Encryption keys. | |
Static Protected Attributes | |
static void(* | m_pReadBytes )(void *, const char *, int) |
Used in ReadBytes. | |
static void(* | m_pWriteBytes )(char *, const void *, int) |
Used in WriteBytes. | |
static bool(* | m_pCompareBytes )(const char *, const void *, int) |
Used in CompareBytes. | |
static bool | g_bWideConversionUseAnsi |
static const TCHAR | m_gszCopyright [] |
Copyright string. | |
Classes | |
class | CWildcard |
A class used in wildcard pattern matching. More... | |
struct | CZipClbckStrg |
Storage for callback objects. More... | |
struct | CZipDeleteInfo |
Holds map of holes and areas to remain when deleting files from the archive. More... | |
struct | CZipInternalInfo |
The purpose of this structure is to hold the data that allow communication with the zlib library. More... | |
struct | CZipSmClrPass |
A structure for the internal use only. More... |
This class provides all the operations on the zip archive.
Definition at line 217 of file ZipArchive.h.
|
Enum values used as iWhich parameter in SetCallback function. You can assign several values to the same callback object (OR them)
Definition at line 418 of file ZipArchive.h. |
|
values used in Close function as parameter iAfterException
Definition at line 1228 of file ZipArchive.h. |
|
case-sensitivity values used as argument iCaseSensitive in FindFile
Definition at line 1137 of file ZipArchive.h. |
|
The open mode of the current file inside archive.
Definition at line 2010 of file ZipArchive.h. |
|
Archive open modes used in
Definition at line 497 of file ZipArchive.h. |
|
enum values used in PredictFileNameInZip
Definition at line 1509 of file ZipArchive.h. |
|
The levels of smartness of the adding files action (see AddNewFile).
Definition at line 602 of file ZipArchive.h. |
|
|
|
|
|
|
|
Add a new file to the archive. You can set the callback object with SetCallback.
|
|
If the parameter iErr signalizes a zlib library error, throw CZipException.
|
|
Close the archive.
|
|
Close the file opened for extraction in the archive and copy its date and attributes to the file pointed by lpszFilePath.
|
|
The same as CZipArchive::CloseFile(LPCTSTR), but additionally closes file.
|
|
Perform the necessary cleanup after an exception was thrown while testing or extracting the archive so that next files in the archive can be tested or extracted. Called by TestFile. Does not remove the file headers information from the central directory. You can use this method after you have extracted only part of the file (not entire file) and you wish to close it.
|
|
Close the new file in the archive.
|
|
Compare iCount bytes.
Definition at line 357 of file ZipArchive.h. References ZipCompatibility::CompareBytesBigEndian(), ZipCompatibility::CompareBytesLittleEndian(), and ZipCompatibility::IsBigEndian(). |
|
|
|
Delete the file from the archive with the given index. You can set the callback object with SetCallback. If you plan to delete more than one file, use one of DeleteFiles functions rather than calling DeleteFile successively, because these functions are optimized for deleting multiple files
|
|
Delete files from the archive. You can set the callback object with SetCallback.
|
|
Delete files from the archive. You can set the callback object with SetCallback. Sorts aIndexes array in an ascending order.
|
|
Enable fast finding by the file name of the files inside the archive.
Set CZipCentralDir::m_bFindFastEnabled to
|
|
Set CZipCentralDir::m_bOemConversion value.
This has only effect on the archives that are created or read under Windows platform. The default value is
Definition at line 1436 of file ZipArchive.h. |
|
The same as
|
|
Extract the file from the archive. You can set the callback object with SetCallback. The argument lpszNewName may point to the full path and is influenced by bFullPath argument (if lpszNewName contains drive specification then it is removed)
|
|
Find the file in the archive.
If the archive wasn't opened with CZipCentralDir::m_bConvertAfterOpen set to
|
|
This function finds the indexes of the files, which filenames match the specified pattern and stores these indexes in the array. The indexes can be used then e.g. in deleting (CZipArchive::DeleteFiles) or extracting files (CZipArchive::ExtractFile).
|
|
Write the central directory to the archive and flushes the internal buffers to the disk, so that the archive is finalized on the disk, but you can still modify it.
Use it after opening (or creating) and modifying the archive if you want to prevent the loss of the data you've compressed so far in case of the program crash.
|
|
|
|
return the current m_bAutoFlush value
Definition at line 1304 of file ZipArchive.h. |
|
Definition at line 468 of file ZipArchive.h. |
|
Return the central directory information.
|
|
Get the central directory size.
Definition at line 1676 of file ZipArchive.h. |
|
Definition at line 1196 of file ZipArchive.h. |
|
A helper for a various purposes (needed e.g. by the program that cracks the zip archives password)
Definition at line 1365 of file ZipArchive.h. |
|
|
|
Get the info of the file with the given index.
|
|
After you enable FindFast feature with EnableFindFast, you can retrieve how the files are sorted in CZipCentralDir::m_findarray (you can use it in your own program if you need to display the sorted list and do not want to duplicate data).
Definition at line 1477 of file ZipArchive.h. |
|
Acquire files with the given indexes from another archive.
Definition at line 850 of file ZipArchive.h. References GetIndexes(). |
|
Acquire files with the given indexes from another archive.
|
|
Acquire a file with the given index from another archive. The compressed data of the file from another archive are copied without decompressing to the current archive. You can set the callback object with SetCallback.
Definition at line 795 of file ZipArchive.h. |
|
|
|
Get indexes of the files stored int aNames array and put them into aIndexes.
Referenced by GetFromArchive(). |
|
Get the local extra filed of the currently opened for extraction file in the archive.
|
|
Calculates the actual size (in bytes) currently occupied by the archive.
Definition at line 1215 of file ZipArchive.h. |
|
Referenced by CZipArchive::CZipSmClrPass::ClearPasswordSmartly(). |
|
Return the current value of m_szRootPath.
Definition at line 588 of file ZipArchive.h. |
|
Return the disk spanning mode of the current archive.
Definition at line 1129 of file ZipArchive.h. |
|
Return the underlying archive storage medium.
Definition at line 1376 of file ZipArchive.h. |
|
Return the system compatibility of the current archive. System compatibility value for the single file in the archive (represented by CZipFileHeader) influences file attributes conversion (the file attributes are defined differently across the platforms). When opening an existing archive CZipArchive assumes the system compatibility of the whole archive to be the same as of the first file in the archive (if present). In other cases the current system value is assumed which is taken from ZipPlatform::GetSystemID during creating or opening an archive
Definition at line 1326 of file ZipArchive.h. |
|
Return the current value of m_szTempPath.
Definition at line 1613 of file ZipArchive.h. |
|
Test if the archive is closed (a whole or the current volume only).
Definition at line 1257 of file ZipArchive.h. |
|
|
|
Open or create the archive in memory. The CZipAbstractFile object is not closed after closing the archive, so that is it possible to work with it afterwards.
|
|
Open or create a zip archive. The archive creation mode depends on iMode and iVolumesSize values:
|
|
Open the file with the given index in the archive for extracting. Not successful opening the file doesn't lock the whole archive, so you can try to open another one (after catching an exception if it was thrown). Throw exception CZipException::badPassword if the password was not set for the encrypted file.
|
|
Open the archive in the given mode. Called by Open(LPCTSTR, int, int) and Open(CZipAbstractFile&, int).
|
|
Add a new file to the opened zip archive. The zip archive cannot be an existing disk spanning archive (existing at the moment of opening archive), because modifying such an archive is not possible (at least not with this version ).
|
|
Predict the full filename with path after extraction.
The parameters (except for the first) are in the form you'd pass to the
|
|
Given the file path in the form it would be passed to AddNewFile as lpszFilePath argument, the function returns the file name as it would be stored in the archive.
|
|
Calls CZipArchive::PredictMaximumFileSizeInArchive(CZipFileHeader&). Before calling, fills the CZipFileHeader structure with the filename as it will appear in the archive and set the proper file size (unless lpszFilePath is a directory).
|
|
Calculate the maximum number of bytes that the file represented by CZipFileHeader would occupy in the current archive. You need to set the following in the structure:
Additionally you may set:
|
|
Read iCount bytes from pSource into pDestination.
Definition at line 319 of file ZipArchive.h. References ZipCompatibility::IsBigEndian(), ZipCompatibility::ReadBytesBigEndian(), and ZipCompatibility::ReadBytesLittleEndian(). |
|
Decompress currently opened file to the buffer.
|
|
Remove recently added file (used by AddNewFile) if compressed is larger than uncompressed or if callback method return
|
|
Remove lpszBeginning from the beginning of the szPath. Both argument are considered to be paths so they matches up to the path separator.
|
|
Change the name of the file with the given index.
|
|
Set the buffer sizes. No buffer can be set smaller than 1024. Use this method before opening the archive. The optimal size for the write buffer in the disk spanning archive is the size of the volume.
|
|
Set the CZipArchive object to call Flush after each operation that modifies the archive (adding a new file, deleting file(s), modifying the global or a file comment). It is useful when we want to prevent the loss of data in case of the program crash - the zip file will be then finalized on the disk. Use it after opening the archive.
|
|
Set callback objects for the following operations on the zip archive: adding, extracting, testing or deleting files. See Action progress notifications (callbacks) information on how to use callback objects.
|
|
Set the default archive case-sensitivity. Affects the following functions:
Definition at line 1658 of file ZipArchive.h. |
|
Set CZipCentralDir::m_bConvertAfterOpen value.
The default value is
Definition at line 1410 of file ZipArchive.h. |
|
Set m_bDetectZlibMemoryLeaks value.
Definition at line 1386 of file ZipArchive.h. |
|
Set the extra field in the central directory of the currently opened file. Must be used after opening a new file in the archive, but before closing it To set the local extra field, set it in the CZipFileHeader structure passed as the argument to the OpenNewFile
|
|
Set the comment of the file with the given index inside the archive.
|
|
Set the attributes for CZipFileHeader structure to be used in OpenNewFile method as an argument. This special procedure is taken, because the system compatibility must be set for CZipFileHeader prior to the value, which must be identical to the return value of GetSystemCompatibility method.
|
|
Set the global comment in the archive.
|
|
If you set bIgnore to This method is useful when working with Java TM Archives (jar). The CRC is checked by default. You can use this function on an opened or closed archive. Definition at line 1695 of file ZipArchive.h. |
|
Set the password for the file to be opened or created. Use this method BEFORE opening or adding a file, but AFTER opening an archive
Referenced by CZipArchive::CZipSmClrPass::ClearPasswordSmartly(). |
|
Set m_szRootPath to a specified value. Use it if you don't want to set bFullPath argument in AddNewFile or ExtractFile to true and you don't want to strip the whole path neither, but only a specific beginning. Use it AFTER opening the archive and before using AddNewFile or ExtractFile. See the FAQ for the example of use.
|
|
Set the callback object used during operations on a PKZIP compatible disk spanning archive to change disks. Set it before opening the archive. If you open the archive in the PKZIP compatible mode and don't set the callback object, the exception CZipException::noCallback will be thrown. Callback object's method CZipSpanCallback::Callback is called when there is a need for a disk change. Calling CZipArchive methods from inside this method may result in an unexpected behavior.
Definition at line 489 of file ZipArchive.h. |
|
Set the system compatibility of the archive. By default it is set to the current system value (the one returned by ZipPlatform::GetSystemID() function). Use it after opening the archive, but before adding a new file or using SetFileHeaderAttr() function
|
|
Set a temporary path used when compressing files and zipsmCheckForEff is specified as an argument in AddNewFile and the disk spanning archive is in creation.
|
|
If you set bSingleDisk to The purpose of this method is to allow reading archives that have improperly set disk numbers. Definition at line 1701 of file ZipArchive.h. |
|
In non-UNICODE version just copy szSingle to szWide. In UNICODE version works the same way as ZipPlatform::SingleToWide
|
|
Test the file with the given index for the integrity. You can set the callback object with SetCallback. The method throws exceptions but performs all the necessary cleanup before, so that the next file can be tested after catching the exception.
|
|
Throw a CZipException error.
|
|
Function used in conjunction with m_szRootPath to trim paths in AddNewFile and ExtractFile.
|
|
|
|
Call it to change how the Unicode string conversion is handled.
If bUseAnsi is set to
Definition at line 303 of file ZipArchive.h. |
|
In non-UNICODE version just copy lpWide to szSingle. In UNICODE version works the same way as ZipPlatform::WideToSingle
|
|
Check if the filename will be duplicted in the archive, if added to the archive in the given form.
|
|
Write iCount bytes from pSource into pDestination.
Definition at line 338 of file ZipArchive.h. References ZipCompatibility::IsBigEndian(), ZipCompatibility::WriteBytesBigEndian(), and ZipCompatibility::WriteBytesLittleEndian(). |
|
Compress the contents of the buffer and write it to a new file.
|
|
Definition at line 2057 of file ZipArchive.h. |
|
The current AutoFlush value.
Definition at line 2028 of file ZipArchive.h. |
|
Default archive case-sensitivity.
Definition at line 1978 of file ZipArchive.h. |
|
Specify whether to control memory allocation and freeing by the zlib library.
Default:
Definition at line 2154 of file ZipArchive.h. |
|
If It affects AddNewFile, ExtractFile, PredictFileNameInZip, PredictExtractedFileName, WillBeDuplicated methods.
Default: Definition at line 1872 of file ZipArchive.h. |
|
Definition at line 1966 of file ZipArchive.h. |
|
A central directory object.
Definition at line 2005 of file ZipArchive.h. |
|
The system code of the current archive. All new files in the archive will be created regarding this value. Can be one of the enum values defined in ZipCompatibility.h
Definition at line 2077 of file ZipArchive.h. |
|
Internal data.
Definition at line 1992 of file ZipArchive.h. |
|
Physical layer of the archive.
Definition at line 1999 of file ZipArchive.h. |
|
The root path to be omitted in AddNewFile and ExtractFile functions from the beginning of the full file path. Set by SetRootPath
Definition at line 2043 of file ZipArchive.h. |
|
A temporary path set with SetTempPath function.
Definition at line 2051 of file ZipArchive.h. |