PDKTZipArchive 0.4.1

PDKTZipArchive 0.4.1

测试已测试
语言语言 CC
许可证 MIT
发布最近发布2016年4月

Daniel García 维护。



  • Sam Soffes

此库是 SSZipLibrary 的分支

由于 SSZipLibrary 存储库的维护不足,我们决定创建此分支。此分支将独立于 SSZipLibrary 进行维护,因此我们没有从 SSZipLibrary 提取更改的计划。

请随意为 PDKTZipLibrary 贡献


PDKTZipArchive

PDKTZipArchive 是一个用于压缩和解压缩文件的简单实用程序类。

您可以执行以下操作

  • 解压 zip 文件;
  • 解压受密码保护的 zip 文件;
  • 创建新的 zip 文件;
  • 追加到现有 zip 文件;
  • zip 文件;
  • 将 NSData 实例 zip。 (具有文件名)

如何将 PDKTZipArchive 添加到您的项目中

  1. PDKTZipArchiveminizip 目录添加到您的项目中。
  2. libz 库添加到您的目标中

PDKTZipArchive 需要 ARC。

用法

// Unzipping
NSString *zipPath = @"path_to_your_zip_file";
NSString *destinationPath = @"path_to_the_folder_where_you_want_it_unzipped";
[PDKTZipArchive unzipFileAtPath:zipPath toDestination:destinationPath];

// Zipping
NSString *zippedPath = @"path_where_you_want_the_file_created";
NSArray *inputPaths = [NSArray arrayWithObjects:
                       [[NSBundle mainBundle] pathForResource:@"photo1" ofType:@"jpg"],
                       [[NSBundle mainBundle] pathForResource:@"photo2" ofType:@"jpg"]
                       nil];
[PDKTZipArchive createZipFileAtPath:zippedPath withFilesAtPaths:inputPaths];

// Zipping directory
[PDKTZipArchive createZipFileAtPath:zippedPath withContentsOfDirectory:inputPath];

许可证

PDKTZipArchive 在 MIT 许可证下受到保护,以及我们略微修改的版本 Minizip 1.1 在 Zlib 许可证下许可。

鸣谢

感谢 aish 创建 ZipArchive。该项目启发了 PDKTZipArchive。感谢 @randomsequence 实现创建支持技术和 @johnezang 在整个过程中的所有出色帮助。