C++ zip文件压缩解压缩 qt解压zip

//解压缩
For unzipping, add "unzip.cpp" to your project. Then, for example,
  #include "unzip.h"
  //
  HZIP hz = OpenZip("c:\\stuff.zip",0);
  ZIPENTRY ze; GetZipItem(hz,-1,&ze); int numitems=ze.index;
  for (int i=0; i<numitems; i++)
  { GetZipItem(hz,i,&ze);
    UnzipItem(hz,i,ze.name);
  }
  CloseZip(hz);

//压缩
For zipping, add "zip.cpp" to your project. (You can add just one of
zip/unzip, or both; they function independently and also co-exist.)
  #include "zip.h"
  //
  HZIP hz = CreateZip("c:\\simple1.zip",0);
  ZipAdd(hz,"znsimple.bmp", "c:\\simple.bmp");
  ZipAdd(hz,"znsimple.txt", "c:\\simple.txt");
  CloseZip(hz);

下载使用

如果对于win32项目。直接上面的链接下载就可以使用

对于qt无法使用报错的问题。进行了简单的封装。目前可以在qt中进行zip的解压。很方便的就可以使用了。

github地址:https://github.com/zhaoxiaolei519109457/unzip.git

如果需要进行压缩等操作。可自行封装

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值