//
//  ZipArchive.h
//  
//
//  Created by aish on 08-9-11.
//  acsolu@gmail.com
//  Copyright 2008  Inc. All rights reserved.
//
// History: 
//    09-11-2008 version 1.0    release
//    10-18-2009 version 1.1    support password protected zip files
//    10-21-2009 version 1.2    fix date bug
// 2012/12/16 for iOS v6 by AIG-Soft
// 2015/09/17 何故かパスワードを掛けたzipは正しいパスワードを入れても解凍できなくなるので使ってはいけない

//#define ENABLE_PASSWORD	// パスワードが使えるようになったら有効にする

#import <UIKit/UIKit.h>

#include "minizip/zip.h"
#include "minizip/unzip.h"


@protocol ZipArchiveDelegate <NSObject>
@optional
-(void) ErrorMessage:(NSString*) msg;
-(BOOL) OverWriteOperation:(NSString*) file;

@end


@interface ZipArchive : NSObject {
@private
	zipFile		_zipFile;
	unzFile		_unzFile;
	
	NSString*   _password;
//	id			_delegate;
}

@property (nonatomic, weak) id <ZipArchiveDelegate> delegate;

-(BOOL) CreateZipFile2:(NSString*) zipFile;
-(BOOL) appendZipFile2:(NSString*) zipFile;	// 2015/09/17 AIG-Soft追加
-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) appendZipFile2:(NSString*) zipFile Password:(NSString*) password;	// 2015/09/17 AIG-Soft追加
-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
-(BOOL) addFileToZipWithFilenameOnly:(NSString*) file newname:(NSString*) newname; // 2012/12/18 AIG-Soft
-(BOOL) CloseZipFile2;

-(BOOL) UnzipOpenFile:(NSString*) zipFile;
-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite exceptExt:(NSString *)ecext; // 2013/01/31 AIG-Soft
-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite;
-(BOOL) UnzipCloseFile;
-(BOOL)checkInZipFile:(NSString*)path exceptExt:(NSString *)ecext;	// 213/11/07 AIG-Soft
@end
