ObjFW  Diff

Differences From Artifact [54dc543184]:

To Artifact [3ce281f546]:


12
13
14
15
16
17
18

19

20
21
22




23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39



40
41
42
43
44
45

46
47
48
49
50
51
52
12
13
14
15
16
17
18
19
20
21



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40


41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56







+

+
-
-
-
+
+
+
+















-
-
+
+
+





-
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFZIPArchiveEntry.h"

#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFSeekableStream;
@class OFStream;

/*!
 * @class OFZIPArchive OFZIPArchive.h ObjFW/OFZIPArchive.h
 *
 * @brief A class for accessing and manipulating ZIP files.
 */
@interface OFZIPArchive: OFObject
{
	OFSeekableStream *_stream;
	uint32_t _diskNumber, _centralDirectoryDisk;
	uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries;
	uint64_t _centralDirectorySize, _centralDirectoryOffset;
	OFString *_archiveComment;
	OFMutableArray *_entries;
	OFMutableDictionary *_pathToEntryMap;
	OFMutableArray OF_GENERIC(OFZIPArchiveEntry*) *_entries;
	OFMutableDictionary OF_GENERIC(OFString*, OFZIPArchiveEntry*)
	    *_pathToEntryMap;
	OFStream *_lastReturnedStream;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *archiveComment;
@property (readonly, copy) OFArray *entries;
@property (readonly, copy) OFArray OF_GENERIC(OFZIPArchiveEntry*) *entries;
#endif

/*!
 * @brief Creates a new OFZIPArchive object with the specified seekable stream.
 *
 * @param stream A seekable stream from which the ZIP archive will be read
 * @return A new, autoreleased OFZIPArchive
85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103







-
+







 *
 * The objects of the array have the same order as the entries in the central
 * directory, which does not need to be the order in which the actual files are
 * stored.
 *
 * @return The entries of the central directory of the archive as an array
 */
- (OFArray*)entries;
- (OFArray OF_GENERIC(OFZIPArchiveEntry*)*)entries;

/*!
 * @brief Returns the archive comment.
 *
 * @return The archive comment
 */
- (OFString*)archiveComment;