Differences From Artifact [6f0db8ecd4]:
- File src/OFZIPArchive.h — part of check-in [cfd374b906] at 2015-01-03 20:57:18 on branch trunk — Update copyright (user: js, size: 2535) [annotate] [blame] [check-ins using]
To Artifact [54dc543184]:
- File
src/OFZIPArchive.h
— part of check-in
[aa1bb213e0]
at
2015-05-09 21:29:43
on branch trunk
— OFZIPArchive: Remove OFFile requirement
Every OFSeekableStream can be used now. (user: js, size: 3357) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
13 14 15 16 17 18 19 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFString.h" | < > | < > > > > > > > > > | | > > > > > > > > > | 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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFString.h" @class OFArray; @class OFMutableArray; @class OFMutableDictionary; @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; OFStream *_lastReturnedStream; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *archiveComment; @property (readonly, copy) OFArray *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 */ + (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream; /*! * @brief Creates a new OFZIPArchive object with the specified file. * * @param path The path to the ZIP file * @return A new, autoreleased OFZIPArchive */ + (instancetype)archiveWithPath: (OFString*)path; /*! * @brief Initializes an already allocated OFZIPArchive object with the * specified seekable stream. * * @param stream A seekable stream from which the ZIP archive will be read * @return An initialized OFZIPArchive */ - initWithSeekableStream: (OFSeekableStream*)stream; /*! * @brief Initializes an already allocated OFZIPArchive object with the * specified file. * * @param path The path to the ZIP file * @return An initialized OFZIPArchive */ - initWithPath: (OFString*)path; |
︙ | ︙ | |||
79 80 81 82 83 84 85 86 87 88 89 90 91 | * * @return The archive comment */ - (OFString*)archiveComment; /*! * @brief Returns a stream for reading the specified file from the archive. * * @param path The path to the file inside the archive * @return A stream for reading the specified file form the archive */ - (OFStream*)streamForReadingFile: (OFString*)path; @end | > > > > | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | * * @return The archive comment */ - (OFString*)archiveComment; /*! * @brief Returns a stream for reading the specified file from the archive. * * @warning Calling @ref streamForReadingFile: will invalidate all streams * previously returned by @ref streamForReadingFile:! Reading from an * invalidated stream will throw an @ref OFReadFailedException! * * @param path The path to the file inside the archive * @return A stream for reading the specified file form the archive */ - (OFStream*)streamForReadingFile: (OFString*)path; @end |