@@ -13,11 +13,10 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" -#import "OFStream.h" OF_ASSUME_NONNULL_BEGIN @class OFDate; @@ -46,17 +45,15 @@ /*! * @class OFTarArchiveEntry OFTarArchiveEntry.h ObjFW/OFTarArchiveEntry.h * * @brief A class which represents an entry of a tar archive. */ -@interface OFTarArchiveEntry: OFStream +@interface OFTarArchiveEntry: OFObject { - OFStream *_stream; - bool _atEndOfStream; OFString *_fileName; uint32_t _mode; - uint64_t _size, _toRead; + uint64_t _size; OFDate *_modificationDate; of_tar_archive_entry_type_t _type; OFString *_targetFileName; OFString *_owner, *_group; uint32_t _deviceMajor, _deviceMinor; @@ -90,21 +87,21 @@ @property (readonly, nonatomic) of_tar_archive_entry_type_t type; /*! * The file name of the target (for a hard link or symbolic link). */ -@property (readonly, nonatomic) OFString *targetFileName; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *targetFileName; /*! * The owner of the file. */ -@property (readonly, nonatomic) OFString *owner; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *owner; /*! * The group of the file. */ -@property (readonly, nonatomic) OFString *group; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *group; /*! * The device major (if the file is a device). */ @property (readonly, nonatomic) uint32_t deviceMajor; @@ -112,9 +109,28 @@ /*! * The device major (if the file is a device). */ @property (readonly, nonatomic) uint32_t deviceMinor; +/*! + * @brief Creates a new OFTarArchiveEntry with the specified file name. + * + * @param fileName The file name for the OFTarArchiveEntry + * @return A new, autoreleased OFTarArchiveEntry + */ ++ (instancetype)entryWithFileName: (OFString *)fileName; + - init OF_UNAVAILABLE; + +/*! + * @brief Initializes an already allocated OFTarArchiveEntry with the specified + * file name. + * + * @param fileName The file name for the OFTarArchiveEntry + * @return An initialized OFTarArchiveEntry + */ +- initWithFileName: (OFString *)fileName; @end OF_ASSUME_NONNULL_END + +#import "OFMutableTarArchiveEntry.h"