@@ -12,10 +12,11 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFZIPArchiveEntry.h" +#import "OFMutableArchiveEntry.h" OF_ASSUME_NONNULL_BEGIN /** * @class OFMutableZIPArchiveEntry \ @@ -22,26 +23,15 @@ * OFMutableZIPArchiveEntry.h ObjFW/OFMutableZIPArchiveEntry.h * * @brief A class which represents a mutable entry in the central directory of * a ZIP archive. */ -@interface OFMutableZIPArchiveEntry: OFZIPArchiveEntry +@interface OFMutableZIPArchiveEntry: OFZIPArchiveEntry { OF_RESERVE_IVARS(OFMutableZIPArchiveEntry, 4) } -/** - * @brief The file name of the entry. - */ -@property (readwrite, copy, nonatomic) OFString *fileName; - -/** - * @brief The comment of the entry's file. - */ -@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) - OFString *fileComment; - /** * @brief The extra field of the entry. * * The item size *must* be 1! */ @@ -65,17 +55,10 @@ * See @ref OFZIPArchiveEntryAttributeCompatibility. */ @property (readwrite, nonatomic) OFZIPArchiveEntryAttributeCompatibility minVersionNeeded; -/** - * @brief The last modification date of the entry's file. - * - * @note Due to limitations of the ZIP format, this has only 2 second precision. - */ -@property (readwrite, retain, nonatomic) OFDate *modificationDate; - /** * @brief The compression method of the entry. * * Supported values are: * Value | Description @@ -87,20 +70,10 @@ * Other values may be returned, but the file cannot be extracted then. */ @property (readwrite, nonatomic) OFZIPArchiveEntryCompressionMethod compressionMethod; -/** - * @brief The compressed size of the entry's file. - */ -@property (readwrite, nonatomic) uint64_t compressedSize; - -/** - * @brief The uncompressed size of the entry's file. - */ -@property (readwrite, nonatomic) uint64_t uncompressedSize; - /** * @brief The CRC32 checksum of the entry's file. */ @property (readwrite, nonatomic) uint32_t CRC32; @@ -117,13 +90,30 @@ * * See the ZIP specification for details. */ @property (readwrite, nonatomic) uint16_t generalPurposeBitFlag; +/** + * @brief Creates a new OFMutableZIPArchiveEntry with the specified file name. + * + * @param fileName The file name for the OFZIPArchiveEntry + * @return A new, autoreleased OFZIPArchiveEntry + */ ++ (instancetype)entryWithFileName: (OFString *)fileName; + +/** + * @brief Initializes an already allocated OFMutableZIPArchiveEntry with the + * specified file name. + * + * @param fileName The file name for the OFZIPArchiveEntry + * @return An initialized OFZIPArchiveEntry + */ +- (instancetype)initWithFileName: (OFString *)fileName; + /** * @brief Converts the OFMutableZIPArchiveEntry to an immutable * OFZIPArchiveEntry. */ - (void)makeImmutable; @end OF_ASSUME_NONNULL_END