@@ -16,11 +16,12 @@ #import "OFObject.h" #import "OFString.h" @class OFFile; -@class OFDictionary; +@class OFArray; +@class OFMutableArray; @class OFMutableDictionary; @class OFStream; /*! * @brief A class for accessing and manipulating ZIP files. @@ -31,16 +32,17 @@ OFString *_path; uint16_t _diskNumber, _centralDirectoryDisk; uint16_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries; uint32_t _centralDirectorySize, _centralDirectoryOffset; OFString *_archiveComment; - OFMutableDictionary *_entries; + OFMutableArray *_entries; + OFMutableDictionary *_pathToEntryMap; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *archiveComment; -@property (readonly, copy) OFDictionary *entries; +@property (readonly, copy) OFArray *entries; #endif /*! * @brief Creates a new OFZIPArchive object for the specified file. * @@ -57,18 +59,20 @@ * @return An initialized OFZIPArchive */ - initWithPath: (OFString*)path; /*! - * @brief Returns the entries in the central directory of the archive as a - * dictionary. - * - * The dictionary maps the file name to an @ref OFZIPArchiveEntry. - * - * @return The entries in the central directory of the archive as a dictionary - */ -- (OFDictionary*)entries; + * @brief Returns the entries of the central directory of the archive as an + * array of objects of class @ref OFZIPArchiveEntry. + * + * The array is sorted by the offset of the local file header, smallest offset + * to largest offset. This way, hard disk seeks are minimized when the array is + * enumerated to extract all files of the archive. + * + * @return The entries of the central directory of the archive as an array + */ +- (OFArray*)entries; /*! * @brief Returns the archive comment. * * @return The archive comment