ObjFW
OFZIPArchiveEntry.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
3  * Jonathan Schleifer <js@webkeks.org>
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 OFDataArray;
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  OFDataArray *_extraField;
99  OFString *_fileComment;
100  uint32_t _startDiskNumber;
101  uint16_t _internalAttributes;
102  uint32_t _versionSpecificAttributes;
103  uint64_t _localFileHeaderOffset;
104 }
105 
106 #ifdef OF_HAVE_PROPERTIES
107 @property (readonly, copy) OFString *fileName, *fileComment;
108 @property (readonly) uint16_t versionMadeBy, minVersionNeeded;
109 @property (readonly) uint16_t compressionMethod;
110 @property (readonly) uint64_t compressedSize, uncompressedSize;
111 @property (readonly, retain) OFDate *modificationDate;
112 @property (readonly) uint32_t CRC32;
113 @property (readonly) uint32_t versionSpecificAttributes;
114 @property (readonly, copy) OFDataArray *extraField;
115 #endif
116 
122 - (OFString*)fileName;
123 
129 - (OFString*)fileComment;
130 
140 - (uint16_t)versionMadeBy;
141 
151 - (uint16_t)minVersionNeeded;
152 
167 - (uint16_t)compressionMethod;
168 
174 - (uint64_t)compressedSize;
175 
181 - (uint64_t)uncompressedSize;
182 
188 - (OFDate*)modificationDate;
189 
195 - (uint32_t)CRC32;
196 
205 - (uint32_t)versionSpecificAttributes;
206 
212 - (OFDataArray*)extraField;
213 @end
214 
215 #ifdef __cplusplus
216 extern "C" {
217 #endif
218 
224 extern OFString* of_zip_archive_entry_version_to_string(uint16_t version);
225 
237 extern void of_zip_archive_entry_extra_field_find(OFDataArray *extraField,
238  uint16_t tag, uint8_t *OF_NONNULL *OF_NONNULL data, uint16_t *size);
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 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
Definition: OFZIPArchiveEntry.h:54
Definition: OFZIPArchiveEntry.h:42
void of_zip_archive_entry_extra_field_find(OFDataArray *extraField, uint16_t tag, uint8_t *OF_NONNULL *OF_NONNULL data, uint16_t *size)
Gets a pointer to and the size of the extensible data field with the specified tag.
A class which provides functions to read, write and manipulate files.
Definition: OFFile.h:47
A class for handling strings.
Definition: OFString.h:91
Definition: OFZIPArchiveEntry.h:50
Definition: OFZIPArchiveEntry.h:34
Definition: OFZIPArchiveEntry.h:58
Definition: OFZIPArchiveEntry.h:66
Definition: OFZIPArchiveEntry.h:72
A class for storing arbitrary data in an array.
Definition: OFDataArray.h:37
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:364
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:33
Definition: OFZIPArchiveEntry.h:48
Definition: OFZIPArchiveEntry.h:60
Definition: OFZIPArchiveEntry.h:46
Definition: OFZIPArchiveEntry.h:68
Definition: OFZIPArchiveEntry.h:56