︙ | | | ︙ | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
* @brief A class for accessing and manipulating ZIP files.
*/
OF_SUBCLASSING_RESTRICTED
@interface OFZIPArchive: OFObject
{
OFStream *_stream;
int64_t _offset;
enum {
OF_ZIP_ARCHIVE_MODE_READ,
OF_ZIP_ARCHIVE_MODE_WRITE,
OF_ZIP_ARCHIVE_MODE_APPEND
} _mode;
uint32_t _diskNumber, _centralDirectoryDisk;
uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries;
uint64_t _centralDirectorySize;
int64_t _centralDirectoryOffset;
OFString *_Nullable _archiveComment;
OFMutableArray OF_GENERIC(OFZIPArchiveEntry *) *_entries;
OFMutableDictionary OF_GENERIC(OFString *, OFZIPArchiveEntry *)
|
<
<
<
<
|
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
* @brief A class for accessing and manipulating ZIP files.
*/
OF_SUBCLASSING_RESTRICTED
@interface OFZIPArchive: OFObject
{
OFStream *_stream;
int64_t _offset;
uint_least8_t _mode;
uint32_t _diskNumber, _centralDirectoryDisk;
uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries;
uint64_t _centralDirectorySize;
int64_t _centralDirectoryOffset;
OFString *_Nullable _archiveComment;
OFMutableArray OF_GENERIC(OFZIPArchiveEntry *) *_entries;
OFMutableDictionary OF_GENERIC(OFString *, OFZIPArchiveEntry *)
|
︙ | | | ︙ | |
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
* @param stream A stream from which the ZIP archive will be read.
* For read and append mode, this needs to be an OFSeekableStream.
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return A new, autoreleased OFZIPArchive
*/
+ (instancetype)archiveWithStream: (OFStream *)stream
mode: (OFString *)mode;
#ifdef OF_HAVE_FILES
/**
* @brief Creates a new OFZIPArchive object with the specified file.
*
* @param path The path to the ZIP file
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return A new, autoreleased OFZIPArchive
*/
+ (instancetype)archiveWithPath: (OFString *)path
mode: (OFString *)mode;
#endif
- (instancetype)init OF_UNAVAILABLE;
/**
* @brief Initializes an already allocated OFZIPArchive object with the
* specified stream.
|
|
<
|
<
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
* @param stream A stream from which the ZIP archive will be read.
* For read and append mode, this needs to be an OFSeekableStream.
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return A new, autoreleased OFZIPArchive
*/
+ (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode;
#ifdef OF_HAVE_FILES
/**
* @brief Creates a new OFZIPArchive object with the specified file.
*
* @param path The path to the ZIP file
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return A new, autoreleased OFZIPArchive
*/
+ (instancetype)archiveWithPath: (OFString *)path mode: (OFString *)mode;
#endif
- (instancetype)init OF_UNAVAILABLE;
/**
* @brief Initializes an already allocated OFZIPArchive object with the
* specified stream.
|
︙ | | | ︙ | |
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
*
* @param path The path to the ZIP file
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return An initialized OFZIPArchive
*/
- (instancetype)initWithPath: (OFString *)path
mode: (OFString *)mode;
#endif
/**
* @brief Returns a stream for reading the specified file from the archive.
*
* @note This method is only available in read mode.
*
|
|
<
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
*
* @param path The path to the ZIP file
* @param mode The mode for the ZIP file. Valid modes are "r" for reading,
* "w" for creating a new file and "a" for appending to an existing
* archive.
* @return An initialized OFZIPArchive
*/
- (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode;
#endif
/**
* @brief Returns a stream for reading the specified file from the archive.
*
* @note This method is only available in read mode.
*
|
︙ | | | ︙ | |
170
171
172
173
174
175
176
177
178
|
- (OFStream *)streamForWritingEntry: (OFZIPArchiveEntry *)entry;
/**
* @brief Closes the OFZIPArchive.
*/
- (void)close;
@end
OF_ASSUME_NONNULL_END
|
>
>
>
>
>
>
>
>
>
>
>
|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
- (OFStream *)streamForWritingEntry: (OFZIPArchiveEntry *)entry;
/**
* @brief Closes the OFZIPArchive.
*/
- (void)close;
@end
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t OFZIPArchiveReadField32(const uint8_t *_Nonnull *_Nonnull,
uint16_t *_Nonnull);
extern uint64_t OFZIPArchiveReadField64(const uint8_t *_Nonnull *_Nonnull,
uint16_t *_Nonnull);
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END
|