C++ zip压缩包操作
(2015-11-21 14:15:34)
标签:
it |
分类: c plus |
zip源码链接:http://pan.baidu.com/s/1jG6Ok6M
只提供了解压源码:unzip.h unzip.cpp
1、上面2个文件添加到自己工程里
2、头文件引用#include "unzip.h"
3、解压代码示例:
//加载zip文件
HZIP hz = OpenZip(zipFileName,
if(!hz)
{
}
//获取压缩包文件个数等信息
ZIPENTRY ze;
ZRESULT zr = GetZipItem(hz,-1,&ze);
if (zr != ZR_OK)
{
}
//解压
char *pDataFile = NULL;
int dataLengthFile = 0;
int numitems = ze.index;
for (int j = 0; j < numitems; ++j)
{
}