ZIP UTILS
-----------
by Lucian Wischik, June 2004 - July 2005
These files are a simple way to add zip/unzip functionality to
your windows programs, both win32 and windows-ce.
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);
There is lot of flexibility... When you unzip, the zipfile can
be a handle or a file on disk or a block of memory or a resource.
And when you unzip the items, you can unzip them directly
to a handle or diskfile or pipe or block of memory. You might
even spawn off a thread to play wav files, connected via a pipe,
and unzip directly from a resource into that pipe.
Similarly you can create a zip in different ways (even creating it
as a dynamically growable buffer that's backed by the system paging
file), and the items you add can come from anywhere.
The functions all support unicode filenames. And the final '0' argument
in OpenZip/CreateZip is for a password, in case of encryption.
For more information, see the header files or the example source code.
The example comes with project files for Visual Studio .NET and
Embedded Visual C++3 and Borland C++Builder6.
The actual core source code for zipping and unzipping comes from
www.info-zip.org and www.gzip.org/zlib, by Jean-Loup Gailly and Mark
Adler and others, and is freely available at the respective
websites. All I did was repackage them and add some small extras.
zip-utils-src 源码
需积分: 0 185 浏览量
更新于2023-07-27
收藏 173KB ZIP 举报
"zip-utils-src 源码"指的是一个开源项目或库的源代码,它提供了处理ZIP格式压缩文件的工具。ZIP是一种广泛使用的文件压缩格式,用于将多个文件组合成一个单一的压缩包,以节省存储空间和方便传输。
"HZIP hz"可能是该项目中特定的压缩算法或者接口的名称。HZIP可能代表了这个库自定义的高效压缩方法,而"hz"可能是HZIP库的简称或者是与该库交互的命令行工具。
"软件/插件"表明这是一组用于开发软件或作为其他软件扩展功能的代码。通常,这样的源码可以被开发者集成到他们的应用程序中,以便添加对ZIP文件的支持,或者创建独立的解压缩工具。
【压缩包子文件的文件名称列表】:
1. **examples** - 这个目录可能包含了一些示例代码或脚本,展示如何使用这个库进行ZIP文件的压缩和解压缩操作。
2. **unzip.h** - 这是一个头文件,包含了关于解压缩函数和数据结构的声明。开发者可以通过包含这个头文件,在自己的C或C++程序中调用相应的API来解压ZIP文件。
3. **新建文本文档.txt** - 这可能是一个示例文件,可能被用来测试压缩和解压缩功能,确保库能正确处理文本文件。
4. **readme.txt** - 这通常是项目提供的说明文档,包含关于如何编译、安装和使用这个库的信息。
5. **zip.h** - 另一个头文件,可能包含了压缩相关函数的声明,如创建、添加文件到ZIP档案等。
6. **unzip.cpp** - 这是解压缩功能的实现文件,包含了与unzip.h中声明的函数相对应的源代码。
7. **zip.cpp** - 这是压缩功能的实现文件,实现了zip.h中声明的函数,用于创建和管理ZIP档案。
"zip-utils-src 源码"是一个用于处理ZIP文件的软件库,包括了压缩和解压缩的功能。开发者可以利用unzip.h和zip.h中的API,并参考examples中的示例代码,将这些功能集成到自己的项目中。通过阅读和学习这些源代码,不仅可以理解ZIP文件格式的工作原理,还可以掌握如何在C或C++项目中高效地使用这类工具。

狗子爱猫咪
- 粉丝: 0
最新资源
- 互联网+任务驱动模式下初中物理教学探索.docx
- 探讨区块链在电商企业财务管理中的应用.docx
- 部分高校学习课程建设网站.doc
- 任务移动通信概述.ppt
- 单片机AT89c51控制步进电动机设计52454.doc
- 基于大数据技术的铁路运输统计研究.docx
- Linux下QQ等软件的安装方法.doc
- 基于互联网的新型大学生家教支教平台的研究.docx
- 单片机多功能电子钟大学本科方案设计书方案设计书.doc
- 基于单片机的指纹打卡门禁系统设计.docx
- 基于JSP的在线购物中购物车的方案设计书与实现.doc
- 二建造师工程项目管理真题及参考答案.doc
- 论电子商务环境下的会计信息化建设措施.docx
- 《信息化管理运作》期末综合练习.doc
- 新形势下计算机基础教学改革策略探索.docx
- s7-基于PLC的全自动洗衣机控制系统设计论文.doc