在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):pixelglow/ZipZap开源软件地址(OpenSource Url):https://github.com/pixelglow/ZipZap开源编程语言(OpenSource Language):Objective-C 68.2%开源软件介绍(OpenSource Introduction):ZipZap is a zip file I/O library for iOS, macOS and tvOS. The zip file is an ideal container for compound Objective-C documents. Zip files are widely used and well understood. You can randomly access their parts. The format compresses decently and has extensive operating system and tool support. So we want to make this format an even easier choice for you. Thus, the library features:
InstallAs an independent project:
As a project integrated with your own workspace:
UseHeader includes: #import <ZipZap/ZipZap.h> Reading an existing zip file: ZZArchive* oldArchive = [ZZArchive archiveWithURL:[NSURL fileURLWithPath:@"/tmp/old.zip"]
error:nil];
ZZArchiveEntry* firstArchiveEntry = oldArchive.entries[0];
NSLog(@"The first entry's uncompressed size is %lu bytes.", (unsigned long)firstArchiveEntry.uncompressedSize);
NSLog(@"The first entry's data is: %@.", [firstArchiveEntry newDataWithError:nil]); Writing a new zip file: ZZArchive* newArchive = [[ZZArchive alloc] initWithURL:[NSURL fileURLWithPath:@"/tmp/new.zip"]
options:@{ZZOpenOptionsCreateIfMissingKey : @YES}
error:nil];
[newArchive updateEntries:
@[
[ZZArchiveEntry archiveEntryWithFileName:@"first.text"
compress:YES
dataBlock:^(NSError** error)
{
return [@"hello, world" dataUsingEncoding:NSUTF8StringEncoding];
}]
]
error:nil]; Updating an existing zip file: ZZArchive* oldArchive = [ZZArchive archiveWithURL:[NSURL fileURLWithPath:@"/tmp/old.zip"]
error:nil];
[oldArchive updateEntries:
[oldArchive.entries arrayByAddingObject:
[ZZArchiveEntry archiveEntryWithFileName:@"second.text"
compress:YES
dataBlock:^(NSError** error)
{
return [@"bye, world" dataUsingEncoding:NSUTF8StringEncoding];
}]]
error:nil]; Advanced uses: Recipes API references: References Require
Support
LicenseZipZap is licensed with the BSD license. Donate
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论