mirror of
https://github.com/MacPaw/XADMaster.git
synced 2025-08-29 03:23:48 +02:00
77 lines
2.9 KiB
Objective-C
77 lines
2.9 KiB
Objective-C
/*
|
|
* XADZipParser.h
|
|
*
|
|
* Copyright (c) 2017-present, MacPaw Inc. All rights reserved.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
* MA 02110-1301 USA
|
|
*/
|
|
#import "XADMacArchiveParser.h"
|
|
#import "XADZipParserStructures.h"
|
|
|
|
@interface XADZipParser:XADMacArchiveParser
|
|
{
|
|
NSMutableDictionary *prevdict;
|
|
NSData *prevname;
|
|
}
|
|
|
|
+(int)requiredHeaderSize;
|
|
+(BOOL)recognizeFileWithHandle:(CSHandle *)handle firstBytes:(NSData *)data name:(NSString *)name;
|
|
+(NSArray *)volumesForHandle:(CSHandle *)handle firstBytes:(NSData *)data name:(NSString *)name;
|
|
|
|
-(id)init;
|
|
-(void)dealloc;
|
|
|
|
-(void)parseWithSeparateMacForks;
|
|
-(void)parseWithCentralDirectoryAtOffset:(off_t)centraloffs zip64Offset:(off_t)zip64offs;
|
|
-(off_t)offsetForVolume:(int)disk offset:(off_t)offset;
|
|
-(void)findCentralDirectoryRecordOffset:(off_t *)centrOffset zip64Offset:(off_t *)zip64offs;
|
|
|
|
-(void)parseWithoutCentralDirectory;
|
|
-(void)findEndOfStreamMarkerWithZip64Flag:(BOOL)zip64 uncompressedSizePointer:(off_t *)uncompsizeptr
|
|
compressedSizePointer:(off_t *)compsizeptr CRCPointer:(uint32_t *)crcptr;
|
|
-(void)findNextEntry;
|
|
|
|
//-(void)findNextZipMarkerStartingAt:(off_t)startpos;
|
|
//-(void)findNoSeekMarkerForDictionary:(NSMutableDictionary *)dict;
|
|
-(NSDictionary *)parseZipExtraWithLength:(int)length nameData:(NSData *)namedata
|
|
uncompressedSizePointer:(off_t *)uncompsizeptr compressedSizePointer:(off_t *)compsizeptr;
|
|
-(XADZipParserCentralDirectoryRecord)readCentralDirectoryRecord;
|
|
|
|
-(void)addZipEntryWithSystem:(int)system
|
|
extractVersion:(int)extractversion
|
|
flags:(int)flags
|
|
compressionMethod:(int)compressionmethod
|
|
date:(uint32_t)date
|
|
crc:(uint32_t)crc
|
|
localDate:(uint32_t)localdate
|
|
compressedSize:(off_t)compsize
|
|
uncompressedSize:(off_t)uncompsize
|
|
extendedFileAttributes:(uint32_t)extfileattrib
|
|
extraDictionary:(NSDictionary *)extradict
|
|
dataOffset:(off_t)dataoffset
|
|
nameData:(NSData *)namedata
|
|
commentData:(NSData *)commentdata
|
|
isLastEntry:(BOOL)islastentry;
|
|
|
|
-(void)rememberEntry:(NSMutableDictionary *)dict withName:(NSData *)namedata;
|
|
-(void)addRemeberedEntryAndForget;
|
|
|
|
-(CSHandle *)rawHandleForEntryWithDictionary:(NSDictionary *)dict wantChecksum:(BOOL)checksum;
|
|
-(CSHandle *)decompressionHandleWithHandle:(CSHandle *)parent method:(int)method flags:(int)flags size:(off_t)size;
|
|
|
|
-(NSString *)formatName;
|
|
|
|
@end
|