Based upon zlib, see http://www.zlib.net/ 了解更多信息。
Groups |
|
EXTRACT_INFO | |
FILETIME | |
ZIP_APPEND | |
ZIP_EXTRACT | |
ZIP_FILE_FLAG | |
ZIP_FILE_FLAG_UNIX | |
ZIP_FLAG | |
ZipMethod |
Classes |
|
struct | ZipFileTime |
struct | ZipFileGlobalInfo |
struct | ZipFileInfo |
struct | ZipWriteInfo |
class | ZipFile |
Macros |
|
#define | COMPRESS_DATA_32_BYTE_PADDING |
#define | LIBRARY_ZIPFILE |
Typedefs |
|
typedef Int32 (* | ExtractDirectoryCallback ) (const Filename &fnSrc, const Filename &fnDest, void *pData, Int32 lInfo) |
函数 |
|
Bool | GetFileTime (const Filename &fn, UINT &nYear, UINT &nMonth, UINT &nDay, UINT &nHour, UINT &nMinute, UINT &nSec, Int32 lType, Bool bIsDir) |
Bool | SetFileTime (const Filename &fn, UINT nYear, UINT nMonth, UINT nDay, UINT nHour, UINT nMinute, UINT nSec, Int32 lType, Bool bIsDir) |
Bool | CompressDataRaw (const void *pSrcData, Int lSrcLen, void *pDestData, Int *plDestLen, Int32 lLevel) |
Bool | UncompressDataRaw (const void *pSrcData, Int lSrcLen, void *pDestData, Int *plDestLen, Int *plRead=nullptr) |
Bool | CompressData (const void *pSrcData, Int lSrcLen, void *&pDestData, Int &lDestLen, Int32 lLevel) |
Bool | UncompressData (const void *pSrcData, Int lSrcLen, void *&pDestData, Int &lDestLen, Int *plRead=nullptr) |
ZHandle * | CompressDataInit ( Int32 lLevel) |
Bool | CompressDataDoIt (ZHandle *handle, const void *pSrcData, Int lSrcLen, void *&pDestData, Int &lDestLen, Int32 lFlags) |
void | CompressDataFree (ZHandle *&handle) |
#define COMPRESS_DATA_32_BYTE_PADDING |
For
CompressData()
,
COMPRESS_DATA_32_BYTE_PADDING
| lLevel to make
lDestLen
a multiple of
32
.
#define LIBRARY_ZIPFILE |
ZIP file library ID.
typedef Int32 (* ExtractDirectoryCallback) (const Filename &fnSrc, const Filename &fnDest, void *pData, Int32 lInfo) |
Called during file extraction.
[in] | fnSrc | The source filename within the ZIP file. |
[in] | fnDest | The filename of the destination file (the extracted file). |
[in] | pData | The private data passed to ZipFile::ExtractToDirectory() . |
[in] | lInfo | The extraction info: EXTRACT_INFO |
Bool GetFileTime | ( | const Filename & | fn , |
UINT & | nYear , | ||
UINT & | nMonth , | ||
UINT & | nDay , | ||
UINT & | nHour , | ||
UINT & | nMinute , | ||
UINT & | nSec , | ||
Int32 | lType , | ||
Bool | bIsDir | ||
) |
Retrieves the time of a file.
[in] | fn | The file to get the time for. |
[out] | nYear | Assigned the year. |
[out] | nMonth | Assigned the month. |
[out] | nDay | Assigned the day. |
[out] | nHour | Assigned the hour. |
[out] | nMinute | Assigned the minute. |
[out] | nSec | Assigned the second. |
[in] | lType | The type of file time to get: FILETIME |
[in] | bIsDir | true for a directory. |
Bool SetFileTime | ( | const Filename & | fn , |
UINT | nYear , | ||
UINT | nMonth , | ||
UINT | nDay , | ||
UINT | nHour , | ||
UINT | nMinute , | ||
UINT | nSec , | ||
Int32 | lType , | ||
Bool | bIsDir | ||
) |
Sets the time of a file.
[in] | fn | The file to set the time for. |
[in] | nYear | The year. |
[in] | nMonth | The month. |
[in] | nDay | The day. |
[in] | nHour | The hour. |
[in] | nMinute | The minute. |
[in] | nSec | The second. |
[in] | lType | The type of file time to set: FILETIME |
[in] | bIsDir | true for a directory. |
Bool CompressDataRaw | ( | const void * | pSrcData , |
Int | lSrcLen , | ||
void * | pDestData , | ||
Int * | plDestLen , | ||
Int32 | lLevel | ||
) |
Compresses data into a caller supplied buffer.
[in] | pSrcData | The source data. |
[in] | lSrcLen | The source data length. |
[in,out] | pDestData | Filled with the compressed data. |
[in,out] | plDestLen |
The compressed data length. The destination buffer needs to be at least
0.1%
bigger than the data to compress plus
12
bytes for the header.
Updated with the actual length used. |
[in] | lLevel | The compression level, ranges from 0 (min) to 9 (max). |
Bool UncompressDataRaw | ( | const void * | pSrcData , |
Int | lSrcLen , | ||
void * | pDestData , | ||
Int * | plDestLen , | ||
Int * |
plRead
=
nullptr
|
||
) |
Uncompresses data into a caller supplied buffer.
[in] | pSrcData | The source data. |
[in] | lSrcLen | The source data length. May not be greater than 2 GB. |
[in,out] | pDestData | Filled with the uncompressed data. The buffer needs to be big enough to fit the uncompressed data. |
[in,out] | plDestLen | The uncompressed data length. Updated with the actual length used. |
[out] | plRead | Assigned the amount of data read. |
Bool CompressData | ( | const void * | pSrcData , |
Int | lSrcLen , | ||
void *& | pDestData , | ||
Int & | lDestLen , | ||
Int32 | lLevel | ||
) |
Compresses data and give the caller a pointer in pDestData to memory that must be freed with DeleteMem() .
[in] | pSrcData | The source data. |
[in] | lSrcLen | The source data length. May not be greater than 2 GB. |
[out] | pDestData | Assigned a pointer to the destination compressed data. Needs to be freed with DeleteMem() . |
[out] | lDestLen |
Assigned the destination length. Pass
COMPRESS_DATA_32_BYTE_PADDING
| lLevel to make
lDestLen
a multiple of
32
.
|
[in] | lLevel | The compression level, ranges from 0 (min) to 9 (max). |
Bool UncompressData | ( | const void * | pSrcData , |
Int | lSrcLen , | ||
void *& | pDestData , | ||
Int & | lDestLen , | ||
Int * |
plRead
=
nullptr
|
||
) |
Uncompresses data and give the caller a pointer in pDestData to memory that must be freed with DeleteMem() .
[in] | pSrcData | The source data. |
[in] | lSrcLen | The source data length. May not be greater than 2 GB. |
[out] | pDestData | Assigned the destination data pointer. Needs to be freed with DeleteMem() . |
[out] | lDestLen | Assigned the destination length. |
[out] | plRead | Assigned the amount of data read. |
ZHandle* CompressDataInit | ( | Int32 | lLevel | ) |
Initializes data compression.
[in] | lLevel | The compression level, ranges from 0 (min) to 9 (max). |
Bool CompressDataDoIt | ( | ZHandle * | handle , |
const void * | pSrcData , | ||
Int | lSrcLen , | ||
void *& | pDestData , | ||
Int & | lDestLen , | ||
Int32 | lFlags | ||
) |
Compresses data.
范例:
[in] | handle | The handle for data compression. |
[in] | pSrcData | The address to the source data. |
[in] | lSrcLen | The size of the source data block. |
[out] | pDestData | Assigned the address of the compressed data. Must be freed with DeleteMem() . |
[out] | lDestLen | Assigned the size of the compressed data block. |
[in] | lFlags | Usually 0 but can be set to COMPRESS_DATA_32_BYTE_PADDING . |
void CompressDataFree | ( | ZHandle *& | handle | ) |
Frees the handle of the compressed data. See also CompressDataDoIt() .
[in,out] | handle | The handle for data compression to be freed. |