ObjFW
 
Loading...
Searching...
No Matches
OFZIPArchiveEntry.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2026 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
26
30typedef enum {
33 OFZIPArchiveEntryCompressionMethodShrink = 1,
34 OFZIPArchiveEntryCompressionMethodReduceFactor1 = 2,
35 OFZIPArchiveEntryCompressionMethodReduceFactor2 = 3,
36 OFZIPArchiveEntryCompressionMethodReduceFactor3 = 4,
37 OFZIPArchiveEntryCompressionMethodReduceFactor4 = 5,
38 OFZIPArchiveEntryCompressionMethodImplode = 6,
43 OFZIPArchiveEntryCompressionMethodBZIP2 = 12,
44 OFZIPArchiveEntryCompressionMethodLZMA = 14,
45 OFZIPArchiveEntryCompressionMethodWavPack = 97,
46 OFZIPArchiveEntryCompressionMethodPPMd = 98
48
94
102
103@class OFString;
104@class OFData;
105@class OFFile;
106@class OFDate;
107
116{
119 uint16_t _generalPurposeBitFlag;
120 OFZIPArchiveEntryCompressionMethod _compressionMethod;
121 uint16_t _lastModifiedFileTime, _lastModifiedFileDate;
122 uint32_t _CRC32;
123 unsigned long long _compressedSize, _uncompressedSize;
124 OFString *_fileName;
125 OFData *_Nullable _extraField;
126 OFString *_Nullable _fileComment;
127 uint32_t _startDiskNumber;
128 uint16_t _internalAttributes;
129 uint32_t _versionSpecificAttributes;
130 int64_t _localFileHeaderOffset;
131 OF_RESERVE_IVARS(OFZIPArchiveEntry, 4)
132}
133
139@property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFData *extraField;
140
148@property (readonly, nonatomic)
150
158@property (readonly, nonatomic)
160
170@property (readonly, nonatomic)
171 OFZIPArchiveEntryCompressionMethod compressionMethod;
172
176@property (readonly, nonatomic) uint32_t CRC32;
177
184@property (readonly, nonatomic) uint32_t versionSpecificAttributes;
185
191@property (readonly, nonatomic) uint16_t generalPurposeBitFlag;
192
193- (instancetype)init OF_UNAVAILABLE;
194@end
195
196#ifdef __cplusplus
197extern "C" {
198#endif
205extern OFString *OFZIPArchiveEntryVersionToString(uint16_t version);
206
215 OFZIPArchiveEntryCompressionMethod compressionMethod);
216
228extern size_t OFZIPArchiveEntryExtraFieldFind(OFData *extraField,
229 OFZIPArchiveEntryExtraFieldTag tag, uint16_t *size);
230#ifdef __cplusplus
231}
232#endif
233
234OF_ASSUME_NONNULL_END
235
236#import "OFMutableZIPArchiveEntry.h"
OFZIPArchiveEntryAttributeCompatibility
Attribute compatibility part of ZIP versions.
Definition OFZIPArchiveEntry.h:52
@ OFZIPArchiveEntryAttributeCompatibilityAtariST
Definition OFZIPArchiveEntry.h:64
@ OFZIPArchiveEntryAttributeCompatibilityOpenVMS
Definition OFZIPArchiveEntry.h:58
@ OFZIPArchiveEntryAttributeCompatibilityOS400
Definition OFZIPArchiveEntry.h:90
@ OFZIPArchiveEntryAttributeCompatibilityAcornRISCOS
Definition OFZIPArchiveEntry.h:80
@ OFZIPArchiveEntryAttributeCompatibilityWindowsNTFS
Definition OFZIPArchiveEntry.h:74
@ OFZIPArchiveEntryAttributeCompatibilityBeOS
Definition OFZIPArchiveEntry.h:86
@ OFZIPArchiveEntryAttributeCompatibilityMacintosh
Definition OFZIPArchiveEntry.h:68
@ OFZIPArchiveEntryAttributeCompatibilityMSDOS
Definition OFZIPArchiveEntry.h:54
@ OFZIPArchiveEntryAttributeCompatibilityMVS
Definition OFZIPArchiveEntry.h:76
@ OFZIPArchiveEntryAttributeCompatibilityCPM
Definition OFZIPArchiveEntry.h:72
@ OFZIPArchiveEntryAttributeCompatibilityVFAT
Definition OFZIPArchiveEntry.h:82
@ OFZIPArchiveEntryAttributeCompatibilityAlternateMVS
Definition OFZIPArchiveEntry.h:84
@ OFZIPArchiveEntryAttributeCompatibilityVSE
Definition OFZIPArchiveEntry.h:78
@ OFZIPArchiveEntryAttributeCompatibilityUNIX
Definition OFZIPArchiveEntry.h:60
@ OFZIPArchiveEntryAttributeCompatibilityOS2HPFS
Definition OFZIPArchiveEntry.h:66
@ OFZIPArchiveEntryAttributeCompatibilityOSX
Definition OFZIPArchiveEntry.h:92
@ OFZIPArchiveEntryAttributeCompatibilityVM_CMS
Definition OFZIPArchiveEntry.h:62
@ OFZIPArchiveEntryAttributeCompatibilityTandem
Definition OFZIPArchiveEntry.h:88
@ OFZIPArchiveEntryAttributeCompatibilityZSystem
Definition OFZIPArchiveEntry.h:70
@ OFZIPArchiveEntryAttributeCompatibilityAmiga
Definition OFZIPArchiveEntry.h:56
OFZIPArchiveEntryCompressionMethod
ZIP compression method.
Definition OFZIPArchiveEntry.h:30
@ OFZIPArchiveEntryCompressionMethodDeflate
Deflate.
Definition OFZIPArchiveEntry.h:40
@ OFZIPArchiveEntryCompressionMethodDeflate64
Deflate64.
Definition OFZIPArchiveEntry.h:42
@ OFZIPArchiveEntryCompressionMethodNone
No compression.
Definition OFZIPArchiveEntry.h:32
OFString * OFZIPArchiveEntryCompressionMethodName(OFZIPArchiveEntryCompressionMethod compressionMethod)
Converts the ZIP entry compression method to a string.
Definition OFZIPArchiveEntry.m:114
OFZIPArchiveEntryExtraFieldTag
Tags for the extra field.
Definition OFZIPArchiveEntry.h:98
@ OFZIPArchiveEntryExtraFieldTagZIP64
Definition OFZIPArchiveEntry.h:100
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:150
OFString * OFZIPArchiveEntryVersionToString(uint16_t version)
Converts the ZIP entry version to a string.
Definition OFZIPArchiveEntry.m:36
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:956
A class for handling strings.
Definition OFString.h:143
A class which represents an entry in the central directory of a ZIP archive.
Definition OFZIPArchiveEntry.h:117
A class which represents an entry in an archive.
Definition OFArchiveEntry.h:66
A protocol for the creation of copies.
Definition OFObject.h:1618
A protocol for the creation of mutable copies.
Definition OFObject.h:1639