@@ -22,11 +22,14 @@ #import "OFZIPArchiveEntry.h" #import "OFZIPArchiveEntry+Private.h" #import "OFDataArray.h" #import "OFArray.h" #import "OFDictionary.h" -#import "OFFile.h" +#import "OFSeekableStream.h" +#ifdef OF_HAVE_FILES +# import "OFFile.h" +#endif #import "OFInflateStream.h" #import "OFInflate64Stream.h" #import "crc32.h" @@ -42,11 +45,10 @@ /* * FIXME: Current limitations: * - Split archives are not supported. * - Write support is missing. - * - The ZIP has to be a file on the local file system. * - Encrypted files cannot be read. */ @interface OFZIPArchive () - (void)OF_readZIPInfo; @@ -137,14 +139,16 @@ + (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream { return [[[self alloc] initWithSeekableStream: stream] autorelease]; } +#ifdef OF_HAVE_FILES + (instancetype)archiveWithPath: (OFString*)path { return [[[self alloc] initWithPath: path] autorelease]; } +#endif - init { OF_INVALID_INIT_METHOD } @@ -164,10 +168,11 @@ } return self; } +#ifdef OF_HAVE_FILES - initWithPath: (OFString*)path { self = [super init]; @try { @@ -181,10 +186,11 @@ @throw e; } return self; } +#endif - (void)dealloc { [_stream release]; [_archiveComment release];