ObjFW  Diff

Differences From Artifact [0e65bfdec8]:

To Artifact [3cb34f0e06]:


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

/*!
 * @class OFZIPArchiveEntry OFZIPArchiveEntry.h ObjFW/OFZIPArchiveEntry.h
 *
 * @brief A class which represents an entry in the central directory of a ZIP
 *	  archive.
 */
@interface OFZIPArchiveEntry: OFObject
{
	uint16_t _versionMadeBy, _minVersionNeeded, _generalPurposeBitFlag;
	uint16_t _compressionMethod;
	uint16_t _lastModifiedFileTime, _lastModifiedFileDate;
	uint32_t _CRC32;
	uint64_t _compressedSize, _uncompressedSize;
	OFString *_fileName;







|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

/*!
 * @class OFZIPArchiveEntry OFZIPArchiveEntry.h ObjFW/OFZIPArchiveEntry.h
 *
 * @brief A class which represents an entry in the central directory of a ZIP
 *	  archive.
 */
@interface OFZIPArchiveEntry: OFObject <OFCopying, OFMutableCopying>
{
	uint16_t _versionMadeBy, _minVersionNeeded, _generalPurposeBitFlag;
	uint16_t _compressionMethod;
	uint16_t _lastModifiedFileTime, _lastModifiedFileDate;
	uint32_t _CRC32;
	uint64_t _compressedSize, _uncompressedSize;
	OFString *_fileName;
107
108
109
110
111
112
113
114





115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133







134
135
136
137
138
139
140
 * The file name of the entry.
 */
@property (readonly, nonatomic) OFString *fileName;

/*!
 * The comment of the entry's file.
 */
@property (readonly, nonatomic) OFString *fileComment;






/*!
 * The version which made the entry.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 */
@property (readonly, nonatomic) uint16_t versionMadeBy;

/*!
 * The minimum version required to extract the file.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 */
@property (readonly, nonatomic) uint16_t minVersionNeeded;








/*!
 * The compression method of the entry.
 *
 * Supported values are:
 * Value                                             | Description
 * --------------------------------------------------|---------------
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE      | No compression







|
>
>
>
>
>



















>
>
>
>
>
>
>







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
 * The file name of the entry.
 */
@property (readonly, nonatomic) OFString *fileName;

/*!
 * The comment of the entry's file.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *fileComment;

/*!
 * The extra field of the entry.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFData *extraField;

/*!
 * The version which made the entry.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 */
@property (readonly, nonatomic) uint16_t versionMadeBy;

/*!
 * The minimum version required to extract the file.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 */
@property (readonly, nonatomic) uint16_t minVersionNeeded;

/*!
 * The last modification date of the entry's file.
 *
 * @note Due to limitations of the ZIP format, this has only 2 second precision.
 */
@property (readonly, nonatomic) OFDate *modificationDate;

/*!
 * The compression method of the entry.
 *
 * Supported values are:
 * Value                                             | Description
 * --------------------------------------------------|---------------
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE      | No compression
171
172
173
174
175
176
177
178
179
180
181
182

183
184

185

186
187
188

189

190
191
192

193
194
195
196
197
198
199
/*!
 * The general purpose bit flag of the entry.
 *
 * See the ZIP specification for details.
 */
@property (readonly, nonatomic) uint16_t generalPurposeBitFlag;

- init OF_UNAVAILABLE;

/*!
 * @brief Returns the last modification date of the entry's file.
 *

 * @return The last modification date of the entry's file
 */

- (OFDate *)modificationDate;


/*!
 * @brief Returns the extra field of the entry.

 *

 * @return The extra field of the entry
 */
- (OFData *)extraField;

@end

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Converts the ZIP entry version to a string







<
<

|

>
|

>
|
>


|
>

>
|

<
>







183
184
185
186
187
188
189


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

207
208
209
210
211
212
213
214
/*!
 * The general purpose bit flag of the entry.
 *
 * See the ZIP specification for details.
 */
@property (readonly, nonatomic) uint16_t generalPurposeBitFlag;



/*!
 * @brief Creates a new OFZIPArchiveEntry with the specified file name.
 *
 * @param fileName The file name for the OFZIPArchiveEntry
 * @return A new, autoreleased OFZIPArchiveEntry
 */
+ (instancetype)entryWithFileName: (OFString *)fileName;

- init OF_UNAVAILABLE;

/*!
 * @brief Initializes an already allocated OFZIPArchiveEntry with the specified
 *	  file name.
 *
 * @param fileName The file name for the OFZIPArchiveEntry
 * @return An initialized OFZIPArchiveEntry
 */

- initWithFileName: (OFString *)fileName;
@end

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Converts the ZIP entry version to a string
217
218
219
220
221
222
223


extern void of_zip_archive_entry_extra_field_find(OFData *extraField,
    uint16_t tag, const uint8_t *_Nonnull *_Nonnull data, uint16_t *size);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END









>
>
232
233
234
235
236
237
238
239
240
extern void of_zip_archive_entry_extra_field_find(OFData *extraField,
    uint16_t tag, const uint8_t *_Nonnull *_Nonnull data, uint16_t *size);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

#import "OFMutableZIPArchiveEntry.h"