ObjFW
OFZIPArchiveEntry.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
23 enum {
24  OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE = 0,
25  OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE = 8,
26  OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE64 = 9
27 };
28 
73 };
74 
75 enum {
76  OF_ZIP_ARCHIVE_ENTRY_EXTRA_FIELD_ZIP64 = 0x0001
77 };
78 
79 @class OFString;
80 @class OFData;
81 @class OFFile;
82 @class OFDate;
83 
91 {
92  uint16_t _versionMadeBy, _minVersionNeeded, _generalPurposeBitFlag;
93  uint16_t _compressionMethod;
94  uint16_t _lastModifiedFileTime, _lastModifiedFileDate;
95  uint32_t _CRC32;
96  uint64_t _compressedSize, _uncompressedSize;
97  OFString *_fileName;
98  OFData *_Nullable _extraField;
99  OFString *_Nullable _fileComment;
100  uint32_t _startDiskNumber;
101  uint16_t _internalAttributes;
102  uint32_t _versionSpecificAttributes;
103  int64_t _localFileHeaderOffset;
104 }
105 
109 @property (readonly, nonatomic) OFString *fileName;
110 
114 @property (readonly, nonatomic) OFString *fileComment;
115 
123 @property (readonly, nonatomic) uint16_t versionMadeBy;
124 
132 @property (readonly, nonatomic) uint16_t minVersionNeeded;
133 
146 @property (readonly, nonatomic) uint16_t compressionMethod;
147 
151 @property (readonly, nonatomic) uint64_t compressedSize;
152 
156 @property (readonly, nonatomic) uint64_t uncompressedSize;
157 
161 @property (readonly, nonatomic) uint32_t CRC32;
162 
169 @property (readonly, nonatomic) uint32_t versionSpecificAttributes;
170 
176 @property (readonly, nonatomic) uint16_t generalPurposeBitFlag;
177 
178 - init OF_UNAVAILABLE;
179 
186 
192 - (OFData *)extraField;
193 @end
194 
195 #ifdef __cplusplus
196 extern "C" {
197 #endif
198 
204 extern OFString *of_zip_archive_entry_version_to_string(uint16_t version);
205 
218  uint16_t tag, const uint8_t *_Nonnull *_Nonnull data, uint16_t *size);
219 #ifdef __cplusplus
220 }
221 #endif
222 
223 OF_ASSUME_NONNULL_END
of_zip_archive_entry_attribute_compatibility
Attribute compatibility part of ZIP versions.
Definition: OFZIPArchiveEntry.h:32
Definition: OFZIPArchiveEntry.h:62
Definition: OFZIPArchiveEntry.h:64
void of_zip_archive_entry_extra_field_find(OFData *extraField, uint16_t tag, const uint8_t *_Nonnull *_Nonnull data, uint16_t *size)
Gets a pointer to and the size of the extensible data field with the specified tag.
Definition: OFZIPArchiveEntry.h:54
Definition: OFZIPArchiveEntry.h:42
A class which provides methods to read and write files.
Definition: OFFile.h:38
uint16_t minVersionNeeded
Definition: OFZIPArchiveEntry.h:132
OFString * fileComment
Definition: OFZIPArchiveEntry.h:114
A class for handling strings.
Definition: OFString.h:114
Definition: OFZIPArchiveEntry.h:50
uint32_t versionSpecificAttributes
Definition: OFZIPArchiveEntry.h:169
Definition: OFZIPArchiveEntry.h:34
OFString * fileName
Definition: OFZIPArchiveEntry.h:109
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
uint16_t versionMadeBy
Definition: OFZIPArchiveEntry.h:123
Definition: OFZIPArchiveEntry.h:58
uint64_t compressedSize
Definition: OFZIPArchiveEntry.h:151
Definition: OFZIPArchiveEntry.h:66
uint16_t compressionMethod
Definition: OFZIPArchiveEntry.h:146
Definition: OFZIPArchiveEntry.h:72
Definition: OFZIPArchiveEntry.h:70
Definition: OFZIPArchiveEntry.h:44
Definition: OFZIPArchiveEntry.h:38
A class which represents an entry in the central directory of a ZIP archive.
Definition: OFZIPArchiveEntry.h:90
Definition: OFZIPArchiveEntry.h:52
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
A class for storing, accessing and comparing dates.
Definition: OFDate.h:30
Definition: OFZIPArchiveEntry.h:40
Definition: OFZIPArchiveEntry.h:36
OFString * of_zip_archive_entry_version_to_string(uint16_t version)
Converts the ZIP entry version to a string.
Definition: OFZIPArchiveEntry.m:35
Definition: OFZIPArchiveEntry.h:48
OFDate * modificationDate()
Returns the last modification date of the entry&#39;s file.
Definition: OFZIPArchiveEntry.m:245
uint16_t generalPurposeBitFlag
Definition: OFZIPArchiveEntry.h:176
OFData * extraField()
Returns the extra field of the entry.
Definition: OFZIPArchiveEntry.m:269
A class for storing arbitrary data in an array.
Definition: OFData.h:34
Definition: OFZIPArchiveEntry.h:60
uint32_t CRC32
Definition: OFZIPArchiveEntry.h:161
Definition: OFZIPArchiveEntry.h:46
Definition: OFZIPArchiveEntry.h:68
Definition: OFZIPArchiveEntry.h:56
uint64_t uncompressedSize
Definition: OFZIPArchiveEntry.h:156