Zip File Library

详细描述

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)

Macro Definition Documentation

◆  COMPRESS_DATA_32_BYTE_PADDING

#define COMPRESS_DATA_32_BYTE_PADDING

For CompressData() , COMPRESS_DATA_32_BYTE_PADDING | lLevel to make lDestLen a multiple of 32 .

◆  LIBRARY_ZIPFILE

#define LIBRARY_ZIPFILE

ZIP file library ID.

Typedef Documentation

◆  ExtractDirectoryCallback

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
返回
The result: EXTRACT_INFO

Function Documentation

◆  GetFileTime()

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.
返回
true if successful, otherwise false .

◆  SetFileTime()

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.
返回
true if successful, otherwise false .

◆  CompressDataRaw()

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).
返回
true if successful, otherwise false .

◆  UncompressDataRaw()

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.
返回
true if successful, otherwise false .

◆  CompressData()

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).
返回
true if successful, otherwise false .

◆  UncompressData()

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.
返回
true if successful, otherwise false .

◆  CompressDataInit()

ZHandle* CompressDataInit ( Int32   lLevel )

Initializes data compression.

另请参阅
CompressDataDoIt()
参数
[in] lLevel The compression level, ranges from 0 (min) to 9 (max).
返回
The handle for data compression.

◆  CompressDataDoIt()

Bool CompressDataDoIt ( ZHandle *  handle ,
const void *  pSrcData ,
Int   lSrcLen ,
void *&  pDestData ,
Int lDestLen ,
Int32   lFlags  
)

Compresses data.
范例:

static ZHandle *zhandle = nullptr ; zhandle = CompressDataInit (5); res = zhandle && CompressDataDoIt (zhandle, c, l, l_zippedmem, l_ziplen, 0); DeleteMem (l_zippedmem); CompressDataFree (zhandle);
参数
[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 .
返回
true if successful, otherwise false .

◆  CompressDataFree()

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.
CompressDataDoIt
Bool CompressDataDoIt(ZHandle *handle, const void *pSrcData, Int lSrcLen, void *&pDestData, Int &lDestLen, Int32 lFlags)
CompressDataInit
ZHandle * CompressDataInit(Int32 lLevel)
maxon::DeleteMem
void DeleteMem(T *&p)
定义: defaultallocator.h:258
CompressDataFree
void CompressDataFree(ZHandle *&handle)

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1