Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f05b2ed31b | ||
|
|
049d1d4359 | ||
|
|
1c2bf920ac | ||
|
|
0148dc65ef | ||
|
|
1f0a183797 |
@@ -39,7 +39,7 @@
|
||||
#import "../Objective-Zip/ZipReadStream.h"
|
||||
|
||||
#define HUGE_TEST_BLOCK_LENGTH (63000)
|
||||
#define HUGE_TEST_NUMBER_OF_BLOCKS (68149)
|
||||
#define HUGE_TEST_NUMBER_OF_BLOCKS (100000)
|
||||
|
||||
|
||||
@implementation Objective_ZipViewController
|
||||
@@ -103,7 +103,8 @@
|
||||
|
||||
[self performSelectorOnMainThread:@selector(log:) withObject:@"Test 1: adding second file..." waitUntilDone:YES];
|
||||
|
||||
ZipWriteStream *stream2= [zipFile writeFileInZipWithName:@"x/y/z/xyz.txt" compressionLevel:ZipCompressionLevelNone];
|
||||
NSString *file2name= @"x/y/z/xyz.txt";
|
||||
ZipWriteStream *stream2= [zipFile writeFileInZipWithName:file2name compressionLevel:ZipCompressionLevelNone];
|
||||
|
||||
[self performSelectorOnMainThread:@selector(log:) withObject:@"Test 1: writing to second file's stream..." waitUntilDone:YES];
|
||||
|
||||
@@ -159,7 +160,7 @@
|
||||
|
||||
[self performSelectorOnMainThread:@selector(log:) withObject:@"Test 1: opening second file..." waitUntilDone:YES];
|
||||
|
||||
[unzipFile goToNextFileInZip];
|
||||
[unzipFile locateFileInZip:file2name];
|
||||
ZipReadStream *read2= [unzipFile readCurrentFileInZip];
|
||||
|
||||
[self performSelectorOnMainThread:@selector(log:) withObject:@"Test 1: reading from second file's stream..." waitUntilDone:YES];
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
@@ -380,6 +381,7 @@
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
INFOPLIST_FILE = "Objective_Zip-Info.plist";
|
||||
PRODUCT_NAME = "Objective-Zip";
|
||||
PROVISIONING_PROFILE = "8D9AD182-36E0-47FE-AB6B-E87632E60994";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -387,6 +389,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Objective_Zip_Prefix.pch;
|
||||
@@ -394,6 +397,7 @@
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
INFOPLIST_FILE = "Objective_Zip-Info.plist";
|
||||
PRODUCT_NAME = "Objective-Zip";
|
||||
PROVISIONING_PROFILE = "8D9AD182-36E0-47FE-AB6B-E87632E60994";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -404,12 +408,15 @@
|
||||
"$(ARCHS_STANDARD_32_BIT)",
|
||||
armv6,
|
||||
);
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.1.2;
|
||||
PROVISIONING_PROFILE = "8D9AD182-36E0-47FE-AB6B-E87632E60994";
|
||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "8D920AE2-DF44-48C7-A9B5-0AB3D42590BB";
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -421,12 +428,15 @@
|
||||
"$(ARCHS_STANDARD_32_BIT)",
|
||||
armv6,
|
||||
);
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Gianluca Bertani (42HXKD6D45)";
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.1.2;
|
||||
PROVISIONING_PROFILE = "8D9AD182-36E0-47FE-AB6B-E87632E60994";
|
||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "8D920AE2-DF44-48C7-A9B5-0AB3D42590BB";
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// FileInZipInfo.h
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// FileInZipInfo.m
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipException.h
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipException.m
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipFile.h
|
||||
// Objective-Zip v.0.8.2
|
||||
// Objective-Zip v.0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipFile.m
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
switch (mode) {
|
||||
case ZipFileModeUnzip:
|
||||
_unzFile= unzOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
_unzFile= unzOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
if (_unzFile == NULL) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithReason:reason] autorelease];
|
||||
@@ -58,7 +58,7 @@
|
||||
break;
|
||||
|
||||
case ZipFileModeCreate:
|
||||
_zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE);
|
||||
_zipFile= zipOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE);
|
||||
if (_zipFile == NULL) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithReason:reason] autorelease];
|
||||
@@ -66,7 +66,7 @@
|
||||
break;
|
||||
|
||||
case ZipFileModeAppend:
|
||||
_zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP);
|
||||
_zipFile= zipOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP);
|
||||
if (_zipFile == NULL) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithReason:reason] autorelease];
|
||||
@@ -109,17 +109,17 @@
|
||||
zi.external_fa= 0;
|
||||
zi.dosDate= 0;
|
||||
|
||||
int err= zipOpenNewFileInZip3(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
NULL, 0);
|
||||
int err= zipOpenNewFileInZip3_64(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
NULL, 0, 1);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -145,17 +145,17 @@
|
||||
zi.external_fa= 0;
|
||||
zi.dosDate= 0;
|
||||
|
||||
int err= zipOpenNewFileInZip3(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
NULL, 0);
|
||||
int err= zipOpenNewFileInZip3_64(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
NULL, 0, 1);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -181,17 +181,17 @@
|
||||
zi.external_fa= 0;
|
||||
zi.dosDate= 0;
|
||||
|
||||
int err= zipOpenNewFileInZip3(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
[password cStringUsingEncoding:NSUTF8StringEncoding], crc32);
|
||||
int err= zipOpenNewFileInZip3_64(
|
||||
_zipFile,
|
||||
[fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
&zi,
|
||||
NULL, 0, NULL, 0, NULL,
|
||||
(compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0,
|
||||
compressionLevel, 0,
|
||||
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
|
||||
[password cStringUsingEncoding:NSUTF8StringEncoding], crc32, 1);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -208,10 +208,10 @@
|
||||
@throw [[[ZipException alloc] initWithReason:reason] autorelease];
|
||||
}
|
||||
|
||||
unz_global_info gi;
|
||||
int err= unzGetGlobalInfo(_unzFile, &gi);
|
||||
unz_global_info64 gi;
|
||||
int err= unzGetGlobalInfo64(_unzFile, &gi);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in getting global info in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error getting global info in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
|
||||
int err= unzGoToFirstFile(_unzFile);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in going to first file in zip in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error going to first file in zip in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@
|
||||
return NO;
|
||||
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in going to next file in zip in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error going to next file in zip in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
return NO;
|
||||
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in going to next file in zip in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error localting file in zip in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -293,11 +293,11 @@
|
||||
}
|
||||
|
||||
char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH];
|
||||
unz_file_info file_info;
|
||||
unz_file_info64 file_info;
|
||||
|
||||
int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -343,11 +343,11 @@
|
||||
}
|
||||
|
||||
char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH];
|
||||
unz_file_info file_info;
|
||||
unz_file_info64 file_info;
|
||||
|
||||
int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
|
||||
err= unzOpenCurrentFilePassword(_unzFile, NULL);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in opening current file in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error opening current file in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -369,11 +369,11 @@
|
||||
}
|
||||
|
||||
char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH];
|
||||
unz_file_info file_info;
|
||||
unz_file_info64 file_info;
|
||||
|
||||
int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
|
||||
err= unzOpenCurrentFilePassword(_unzFile, [password cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in opening current file in '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error opening current file in '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@
|
||||
case ZipFileModeUnzip: {
|
||||
int err= unzClose(_unzFile);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
break;
|
||||
@@ -402,7 +402,7 @@
|
||||
case ZipFileModeCreate: {
|
||||
int err= zipClose(_zipFile, NULL);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
break;
|
||||
@@ -411,7 +411,7 @@
|
||||
case ZipFileModeAppend: {
|
||||
int err= zipClose(_zipFile, NULL);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipReadStream.h
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 28/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipReadStream.m
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 28/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
@@ -52,7 +52,7 @@
|
||||
- (NSUInteger) readDataWithBuffer:(NSMutableData *)buffer {
|
||||
int err= unzReadCurrentFile(_unzFile, [buffer mutableBytes], [buffer length]);
|
||||
if (err < 0) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in reading '%@' in the zipfile", _fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error reading '%@' in the zipfile", _fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
- (void) finishedReading {
|
||||
int err= unzCloseCurrentFile(_unzFile);
|
||||
if (err != UNZ_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in closing '%@' in the zipfile", _fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error closing '%@' in the zipfile", _fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipWriteStream.h
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// ZipWriteStream.m
|
||||
// Objective-Zip v. 0.8.2
|
||||
// Objective-Zip v. 0.8.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-10 Flying Dolphin Studio. All rights reserved.
|
||||
@@ -52,7 +52,7 @@
|
||||
- (void) writeData:(NSData *)data {
|
||||
int err= zipWriteInFileInZip(_zipFile, [data bytes], [data length]);
|
||||
if (err < 0) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in writing '%@' in the zipfile", _fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error writing '%@' in the zipfile", _fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@
|
||||
- (void) finishedWriting {
|
||||
int err= zipCloseFileInZip(_zipFile);
|
||||
if (err != ZIP_OK) {
|
||||
NSString *reason= [NSString stringWithFormat:@"Error in closing '%@' in the zipfile", _fileNameInZip];
|
||||
NSString *reason= [NSString stringWithFormat:@"Error closing '%@' in the zipfile", _fileNameInZip];
|
||||
@throw [[[ZipException alloc] initWithError:err reason:reason] autorelease];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">4 GB Zip & Unzip (use with caution)</string>
|
||||
<string key="IBUINormalTitle">6.3 GB Zip & Unzip (use with caution)</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="884333554"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
|
||||
15
README.md
15
README.md
@@ -18,8 +18,8 @@ The source repository contains a sample application with full
|
||||
sources for ZLib, MiniZip and Objective-Zip, together with a unit test
|
||||
UI. The versions included are:
|
||||
|
||||
- 1.2.8 for [ZLib](http://zlib.net)
|
||||
- 1.1 for [MiniZip](https://github.com/nmoinvaz/minizip)
|
||||
- 1.2.8 for [ZLib](http://zlib.net).
|
||||
- 1.1 for [MiniZip](https://github.com/nmoinvaz/minizip).
|
||||
- latest version for Objective-Zip.
|
||||
|
||||
Please note that ZLib and MiniZip are included here only to provide a
|
||||
@@ -32,7 +32,7 @@ informations.
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
Please see **GETTING_STARTED.md**.
|
||||
Please see [Getting Started](https://github.com/flyingdolphinstudio/Objective-Zip/blob/master/GETTING_STARTED.md).
|
||||
|
||||
|
||||
License
|
||||
@@ -44,10 +44,15 @@ The library is distributed under the New BSD License.
|
||||
Version history
|
||||
---------------
|
||||
|
||||
Version 0.8.3:
|
||||
|
||||
- Finally used correctly the 64 bit APIs. Thanks to Nathan Moinvaziri for advicing.
|
||||
- Updated test code to zip & unzip up to 6.3 GB.
|
||||
|
||||
Version 0.8.2:
|
||||
|
||||
- Updated ZLib to 1.2.8
|
||||
- Updated MiniZip to Nathan Moinvaziri's Version
|
||||
- Updated MiniZip to Nathan Moinvaziri's Version (thanks [Sergio](http://mrsergio.com) for the suggestions)
|
||||
- Added test code to zip & unzip up to (slighlty less than) 4 GB:
|
||||
the library is able to create and expand files up to
|
||||
4,293,387,000 bytes (compressed); use the test with caution,
|
||||
@@ -85,7 +90,7 @@ Version 0.7.0:
|
||||
Compatibility
|
||||
-------------
|
||||
|
||||
Version 0.8.2 has been tested with iOS from 5.1 to 6.1, but should be
|
||||
Version 0.8.3 has been tested with iOS from 5.1 to 6.1, but should be
|
||||
compatible with earlier versions too. Le me know of any issues that
|
||||
should arise.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user