ObjFW
Loading...
Searching...
No Matches
OFZIPArchiveEntry.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFArchiveEntry.h"
22
23OF_ASSUME_NONNULL_BEGIN
24
27typedef enum {
28 OFZIPArchiveEntryCompressionMethodNone = 0,
29 OFZIPArchiveEntryCompressionMethodShrink = 1,
30 OFZIPArchiveEntryCompressionMethodReduceFactor1 = 2,
31 OFZIPArchiveEntryCompressionMethodReduceFactor2 = 3,
32 OFZIPArchiveEntryCompressionMethodReduceFactor3 = 4,
33 OFZIPArchiveEntryCompressionMethodReduceFactor4 = 5,
34 OFZIPArchiveEntryCompressionMethodImplode = 6,
35 OFZIPArchiveEntryCompressionMethodDeflate = 8,
36 OFZIPArchiveEntryCompressionMethodDeflate64 = 9,
37 OFZIPArchiveEntryCompressionMethodBZIP2 = 12,
38 OFZIPArchiveEntryCompressionMethodLZMA = 14,
39 OFZIPArchiveEntryCompressionMethodWavPack = 97,
40 OFZIPArchiveEntryCompressionMethodPPMd = 98
41} OFZIPArchiveEntryCompressionMethod;
42
88
96
97@class OFString;
98@class OFData;
99@class OFFile;
100@class OFDate;
101
110{
113 uint16_t _generalPurposeBitFlag;
114 OFZIPArchiveEntryCompressionMethod _compressionMethod;
115 uint16_t _lastModifiedFileTime, _lastModifiedFileDate;
116 uint32_t _CRC32;
117 unsigned long long _compressedSize, _uncompressedSize;
118 OFString *_fileName;
119 OFData *_Nullable _extraField;
120 OFString *_Nullable _fileComment;
121 uint32_t _startDiskNumber;
122 uint16_t _internalAttributes;
123 uint32_t _versionSpecificAttributes;
124 int64_t _localFileHeaderOffset;
125 OF_RESERVE_IVARS(OFZIPArchiveEntry, 4)
126}
127
133@property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFData *extraField;
142@property (readonly, nonatomic)
152@property (readonly, nonatomic)
167@property (readonly, nonatomic)
168 OFZIPArchiveEntryCompressionMethod compressionMethod;
173@property (readonly, nonatomic) uint32_t CRC32;
181@property (readonly, nonatomic) uint32_t versionSpecificAttributes;
188@property (readonly, nonatomic) uint16_t generalPurposeBitFlag;
190- (instancetype)init OF_UNAVAILABLE;
191@end
192
193#ifdef __cplusplus
194extern "C" {
195#endif
202extern OFString *OFZIPArchiveEntryVersionToString(uint16_t version);
203
212 OFZIPArchiveEntryCompressionMethod compressionMethod);
213
225extern size_t OFZIPArchiveEntryExtraFieldFind(OFData *extraField,
226 OFZIPArchiveEntryExtraFieldTag tag, uint16_t *size);
227#ifdef __cplusplus
228}
229#endif
230
231OF_ASSUME_NONNULL_END
232
233#import "OFMutableZIPArchiveEntry.h"
OFZIPArchiveEntryAttributeCompatibility
Attribute compatibility part of ZIP versions.
Definition OFZIPArchiveEntry.h:46
@ OFZIPArchiveEntryAttributeCompatibilityAtariST
Definition OFZIPArchiveEntry.h:58
@ OFZIPArchiveEntryAttributeCompatibilityOpenVMS
Definition OFZIPArchiveEntry.h:52
@ OFZIPArchiveEntryAttributeCompatibilityOS400
Definition OFZIPArchiveEntry.h:84
@ OFZIPArchiveEntryAttributeCompatibilityAcornRISCOS
Definition OFZIPArchiveEntry.h:74
@ OFZIPArchiveEntryAttributeCompatibilityWindowsNTFS
Definition OFZIPArchiveEntry.h:68
@ OFZIPArchiveEntryAttributeCompatibilityBeOS
Definition OFZIPArchiveEntry.h:80
@ OFZIPArchiveEntryAttributeCompatibilityMacintosh
Definition OFZIPArchiveEntry.h:62
@ OFZIPArchiveEntryAttributeCompatibilityMSDOS
Definition OFZIPArchiveEntry.h:48
@ OFZIPArchiveEntryAttributeCompatibilityMVS
Definition OFZIPArchiveEntry.h:70
@ OFZIPArchiveEntryAttributeCompatibilityCPM
Definition OFZIPArchiveEntry.h:66
@ OFZIPArchiveEntryAttributeCompatibilityVFAT
Definition OFZIPArchiveEntry.h:76
@ OFZIPArchiveEntryAttributeCompatibilityAlternateMVS
Definition OFZIPArchiveEntry.h:78
@ OFZIPArchiveEntryAttributeCompatibilityVSE
Definition OFZIPArchiveEntry.h:72
@ OFZIPArchiveEntryAttributeCompatibilityUNIX
Definition OFZIPArchiveEntry.h:54
@ OFZIPArchiveEntryAttributeCompatibilityOS2HPFS
Definition OFZIPArchiveEntry.h:60
@ OFZIPArchiveEntryAttributeCompatibilityOSX
Definition OFZIPArchiveEntry.h:86
@ OFZIPArchiveEntryAttributeCompatibilityVM_CMS
Definition OFZIPArchiveEntry.h:56
@ OFZIPArchiveEntryAttributeCompatibilityTandem
Definition OFZIPArchiveEntry.h:82
@ OFZIPArchiveEntryAttributeCompatibilityZSystem
Definition OFZIPArchiveEntry.h:64
@ OFZIPArchiveEntryAttributeCompatibilityAmiga
Definition OFZIPArchiveEntry.h:50
OFString * OFZIPArchiveEntryCompressionMethodName(OFZIPArchiveEntryCompressionMethod compressionMethod)
Converts the ZIP entry compression method to a string.
Definition OFZIPArchiveEntry.m:112
OFZIPArchiveEntryExtraFieldTag
Tags for the extra field.
Definition OFZIPArchiveEntry.h:92
@ OFZIPArchiveEntryExtraFieldTagZIP64
Definition OFZIPArchiveEntry.h:94
size_t OFZIPArchiveEntryExtraFieldFind(OFData *extraField, OFZIPArchiveEntryExtraFieldTag tag, uint16_t *size)
Gets a pointer to and the size of the extensible data field with the specified tag.
Definition OFZIPArchiveEntry.m:148
OFString * OFZIPArchiveEntryVersionToString(uint16_t version)
Converts the ZIP entry version to a string.
Definition OFZIPArchiveEntry.m:34
A class for storing arbitrary data in an array.
Definition OFData.h:46
A class for storing, accessing and comparing dates.
Definition OFDate.h:34
A class which provides methods to read and write files.
Definition OFFile.h:41
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:139
A class which represents an entry in the central directory of a ZIP archive.
Definition OFZIPArchiveEntry.h:111
A class which represents an entry in an archive.
Definition OFArchiveEntry.h:33
A protocol for the creation of copies.
Definition OFObject.h:1350
A protocol for the creation of mutable copies.
Definition OFObject.h:1371