Cocos2d-x3.0 解压zip
来源:未知 责任编辑:责任编辑 发表时间:2014-05-20 18:26 点击:次
2dx3.0为我们集成了unzip库,帮助我们实现对文件的解压,但使用起来略显复杂我这里封装了一个解压工具库。分享一下。
先引入头文件
#include DJZipArchive.h
实现解压代码
//获取文件路径 const char* file_path = FileUtils::getInstance()->fullPathForFilename(hello.zip).c_str(); log(external file path = %s,file_path); DJZipArchive* djzip = new DJZipArchive(); //file_path zip文件的路径 djzip->unzipOpenFile(file_path); std::string writablePath = FileUtils::getInstance()->getWritablePath(); std::string fullPath = writablePath; log(%s,fullPath.c_str()); // fullPath 解压文件储存路径 djzip->unzipFileToAndOverWrite(fullPath, true);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>
您可能感兴趣的文章
- COCOS2D-X之不断变化的数字效果Demo
- 十三 手游开发神器 cocos2d-x editor 之选关滑动界面(ScrollV
- MeeGo开发命令行简记
- cocos2dX 之CCParticle
- cocos2dx 某缩放的页面 CCTableView最后一个标签无法点中
- Cocos2dx 3.0 过渡篇(二十五)死不了的贪食蛇(触摸版)
- cocos2d-x 2.0.3 设置高清模式注意事项(cocos2d-x 2.0.3 设置高
- Cocos2d-x初学指南(6): 模拟一个触摸摇杆做为虚拟按键
- cocos2d-x学习笔记(7)--动作(Actions)
- Cocos2d-x 3.2 大富翁游戏项目开发-第十部分实现人物轮流行走