Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I merge from others commit, and add a project for methods sample. #46

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dea5f4d
Include zlib.h correctly
agnat Sep 16, 2014
d119fd7
do not link libs on iOS
agnat Sep 16, 2014
24baac6
Committing version changes
agnat Sep 16, 2014
bddd0b4
Xcode Upgrade chnges
agnat Sep 22, 2014
fef5fa1
Decompression progress updates using delegates (instead of block).
techrah Sep 24, 2014
8b9df40
Reverted import statements for zlib and zconf. Uncertain how they got…
techrah Sep 24, 2014
edee78d
Comment spelling correction.
techrah Sep 24, 2014
aa9ea81
added a method to unzip zipped file to memory
Oct 13, 2014
2fe5654
- fixed excessive memory usage on archive creation
pavel-mayer Oct 30, 2014
14d37cd
- version number checks
pavel-mayer Nov 8, 2014
09efe62
Merge branch 'master' of https://github.com/turenus/ZipArchive
TechD-Robin Jan 8, 2015
7c604df
Merge branch 'master' of https://github.com/OpenFibers/ZipArchive
TechD-Robin Jan 8, 2015
c1048a3
add define check for OS version, to remove build warning;
TechD-Robin Jan 8, 2015
c5a27df
modify check os version condition.
TechD-Robin Jan 9, 2015
0347413
fixed bug, when include the library into Mac application.
TechD-Robin Jan 9, 2015
58cea7e
fix bug refer from : https://github.com/mattconnolly/ZipArchive/pull/…
TechD-Robin Jan 9, 2015
d353400
Merge branch 'master' of https://github.com/ryanhomer/ZipArchive into…
TechD-Robin Jan 9, 2015
573bb98
Refactoring define check for OS version, to remove build warning;
TechD-Robin Jan 9, 2015
e0a9a9e
Refactoring for ARC check, change to use SAFE_ARC macro.
TechD-Robin Jan 9, 2015
765cc9f
add a project for demo method (empty).
TechD-Robin Jan 12, 2015
ec7d04f
import the library & add some base method for tableview(sample use).
TechD-Robin Jan 12, 2015
ae6878f
add sample for base unzip method.
TechD-Robin Jan 12, 2015
9c0c425
add sample for unzip method with delegate option method (unzip progre…
TechD-Robin Jan 12, 2015
b7c46b0
fix bug refer from this commit : https://github.com/kolyvan/ZipArchiv…
TechD-Robin Jan 13, 2015
b695024
add a sample for zip file.
TechD-Robin Jan 14, 2015
d5a16b4
Added the addFolder... method
j4v1n8r Sep 26, 2013
6c6e3fb
modify a sample for addFolderToZip.
TechD-Robin Jan 14, 2015
2b7f922
add a progress block parameter for new addFolderToZip method.
TechD-Robin Jan 14, 2015
f0105f8
add a filename parameter to progress update block
TechD-Robin Jan 14, 2015
c76776e
update podspec.
TechD-Robin Jan 14, 2015
a75e5bd
remove demo project.
TechD-Robin Jan 21, 2015
230a050
remove method addFolderTozip.
TechD-Robin Jan 21, 2015
abb9476
exchange the method of calendar for will deprecate.
TechD-Robin Jan 21, 2015
9959f18
remove filename parameter from ZipArchiveProgressUpdateBlock.
TechD-Robin Jan 21, 2015
97afa23
Merge branch 'master' of https://github.com/mattconnolly/ZipArchive
TechD-Robin Jan 21, 2015
27af922
fix bug about components.month when zip file.
TechD-Robin Jan 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 48 additions & 44 deletions ZipArchive.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/**
// @header ZipArchive.h
//
// An objective C wrapper for minizip and libz for creating and exanding ZIP files.
//
// @author Created by aish on 08-9-11.
// [email protected]
// @copyright Copyright 2008 Inc. All rights reserved.
//
*/
// @header ZipArchive.h
//
// An objective C wrapper for minizip and libz for creating and exanding ZIP files.
//
// @author Created by aish on 08-9-11.
// [email protected]
// @copyright Copyright 2008 Inc. All rights reserved.
//
*/

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif


typedef NS_ENUM(NSInteger, ZipArchiveCompression) {
Expand All @@ -24,59 +28,59 @@ typedef NS_ENUM(NSInteger, ZipArchiveCompression) {
total number of files in the archive is called after each file is processed.
*/
typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed, unsigned long numFiles);

/**
@protocol
@discussion methods for a delegate to receive error notifications and control overwriting of files
*/
@protocol
@discussion methods for a delegate to receive error notifications and control overwriting of files
*/

@protocol ZipArchiveDelegate <NSObject>
@optional

/**
@brief Delegate method to be notified of errors
ZipArchive calls this selector on the delegate when errors are encountered.
@param msg a string describing the error.
@result void
*/
@brief Delegate method to be notified of errors

ZipArchive calls this selector on the delegate when errors are encountered.

@param msg a string describing the error.
@result void
*/

-(void) ErrorMessage:(NSString*) msg;

/**
@brief Delegate method to determine if a file should be replaced
When an zip file is being expanded and a file is about to be replaced, this selector
is called on the delegate to notify that file is about to be replaced. The delegate method
should return YES to overwrite the file, or NO to skip it.
@brief Delegate method to determine if a file should be replaced

When an zip file is being expanded and a file is about to be replaced, this selector
is called on the delegate to notify that file is about to be replaced. The delegate method
should return YES to overwrite the file, or NO to skip it.

@param file - path to the file to be overwritten.
@result a BOOL - YES to replace, NO to skip
*/
@param file - path to the file to be overwritten.
@result a BOOL - YES to replace, NO to skip
*/

-(BOOL) OverWriteOperation:(NSString*) file;

@end

/**
@class
@brief An object that can create zip files and expand existing ones.
This class provides methods to create a zip file (optionally with a password) and
add files to that zip archive.
It also provides methods to expand an existing archive file (optionally with a password),
and extract the files.
*/
@class
@brief An object that can create zip files and expand existing ones.
This class provides methods to create a zip file (optionally with a password) and
add files to that zip archive.

It also provides methods to expand an existing archive file (optionally with a password),
and extract the files.
*/

@interface ZipArchive : NSObject {
@private
void* _zipFile;
void* _unzFile;
void* _zipFile;
void* _unzFile;
unsigned long _numFiles;
NSString* _password;
id _delegate;
NSString* _password;
id _delegate;
ZipArchiveProgressUpdateBlock _progressBlock;

NSArray* _unzippedFiles;
Expand All @@ -93,8 +97,8 @@ typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed,
@property (nonatomic, assign) ZipArchiveCompression compression;

/**
@brief String encoding to be used when interpreting file names in the zip file.
*/
@brief String encoding to be used when interpreting file names in the zip file.
*/
@property (nonatomic, assign) NSStringEncoding stringEncoding;

/** an array of files that were successfully expanded. Available after calling UnzipFileTo:overWrite: */
Expand All @@ -121,4 +125,4 @@ typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed,
// `getZipFileContents` result won't be updated until re-unzip-open after close write handle (`CloseZipFile2` then `UnzipCloseFile` then (`UnzipOpenFile:` or `UnzipOpenFile:Password`) get called).
-(NSArray*) getZipFileContents;

@end
@end
Loading