2010-07-22 07:05:38 +08:00
|
|
|
//
|
2010-08-20 04:27:48 +08:00
|
|
|
// SSZipArchive.h
|
|
|
|
// SSZipArchive
|
2010-07-22 07:05:38 +08:00
|
|
|
//
|
|
|
|
// Created by Sam Soffes on 7/21/10.
|
2011-10-04 14:28:54 +08:00
|
|
|
// Copyright (c) Sam Soffes 2010-2011. All rights reserved.
|
2010-07-22 07:05:38 +08:00
|
|
|
//
|
|
|
|
|
2011-10-04 14:28:54 +08:00
|
|
|
#import <Foundation/Foundation.h>
|
2012-05-08 13:27:45 +08:00
|
|
|
#include "minizip/unzip.h"
|
|
|
|
|
|
|
|
@protocol SSZipArchiveDelegate;
|
2011-10-04 14:28:54 +08:00
|
|
|
|
2011-12-27 12:32:55 +08:00
|
|
|
@interface SSZipArchive : NSObject
|
2010-07-22 07:05:38 +08:00
|
|
|
|
2011-12-20 17:24:56 +08:00
|
|
|
// Unzip
|
2010-07-22 07:05:38 +08:00
|
|
|
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
|
2010-07-23 23:41:46 +08:00
|
|
|
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error;
|
2010-07-22 07:05:38 +08:00
|
|
|
|
2012-01-15 03:46:32 +08:00
|
|
|
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate;
|
|
|
|
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error delegate:(id<SSZipArchiveDelegate>)delegate;
|
|
|
|
|
2011-12-20 17:24:56 +08:00
|
|
|
// Zip
|
|
|
|
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)filenames;
|
|
|
|
|
|
|
|
- (id)initWithPath:(NSString *)path;
|
|
|
|
- (BOOL)open;
|
|
|
|
- (BOOL)writeFile:(NSString *)path;
|
|
|
|
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename;
|
|
|
|
- (BOOL)close;
|
|
|
|
|
2010-07-22 07:05:38 +08:00
|
|
|
@end
|
2012-05-08 13:27:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
@protocol SSZipArchiveDelegate <NSObject>
|
|
|
|
|
|
|
|
@optional
|
|
|
|
|
2012-05-08 14:05:06 +08:00
|
|
|
- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo;
|
|
|
|
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath;
|
|
|
|
|
2012-05-08 13:27:45 +08:00
|
|
|
- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
|
|
|
|
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
|
|
|
|
|
|
|
|
@end
|