Files
ZipArchive/SSZipArchive/SSZipArchive.h
T

54 lines
2.1 KiB
Objective-C
Raw Normal View History

2010-07-21 18:05:38 -05:00
//
2010-08-19 15:27:48 -05:00
// SSZipArchive.h
// SSZipArchive
2010-07-21 18:05:38 -05:00
//
// Created by Sam Soffes on 7/21/10.
2014-01-01 11:00:26 -08:00
// Copyright (c) Sam Soffes 2010-2014. All rights reserved.
2010-07-21 18:05:38 -05:00
//
#ifndef _SSZIPARCHIVE_H
#define _SSZIPARCHIVE_H
2011-10-03 23:28:54 -07:00
#import <Foundation/Foundation.h>
2013-09-10 00:03:11 -07:00
#include "unzip.h"
@protocol SSZipArchiveDelegate;
2011-10-03 23:28:54 -07:00
2011-12-26 23:32:55 -05:00
@interface SSZipArchive : NSObject
2010-07-21 18:05:38 -05:00
2011-12-20 09:24:56 +00:00
// Unzip
2010-07-21 18:05:38 -05:00
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
2010-07-23 10:41:46 -05:00
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error;
2010-07-21 18:05:38 -05:00
2012-01-14 20:46:32 +01: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 09:24:56 +00:00
// Zip
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)filenames;
2013-03-09 05:36:20 -08:00
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
2011-12-20 09:24:56 +00:00
- (id)initWithPath:(NSString *)path;
- (BOOL)open;
- (BOOL)writeFile:(NSString *)path;
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename;
- (BOOL)close;
2010-07-21 18:05:38 -05:00
@end
@protocol SSZipArchiveDelegate <NSObject>
@optional
2012-05-07 23:05:06 -07:00
- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo;
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath;
2014-07-16 11:28:25 -07:00
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
- (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;
2014-03-14 21:22:20 -04:00
- (void)zipArchiveProgressEvent:(NSInteger)loaded total:(NSInteger)total;
@end
#endif /* _SSZIPARCHIVE_H */