@@ -14,10 +14,11 @@ */ #include "config.h" #import "OFMutableLHAArchiveEntry.h" +#import "OFLHAArchiveEntry+Private.h" #import "OFArray.h" #import "OFData.h" #import "OFDate.h" #import "OFNumber.h" @@ -25,10 +26,29 @@ @implementation OFMutableLHAArchiveEntry @dynamic fileName, compressionMethod, compressedSize, uncompressedSize, date; @dynamic headerLevel, CRC16, operatingSystemIdentifier, fileComment, mode, UID; @dynamic GID, owner, group, modificationDate, extensions; + ++ (instancetype)entryWithFileName: (OFString *)fileName +{ + return [[[self alloc] initWithFileName: fileName] autorelease]; +} + +- (instancetype)initWithFileName: (OFString *)fileName +{ + self = [super of_init]; + + @try { + _fileName = [fileName copy]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} - (id)copy { OFMutableLHAArchiveEntry *copy = [self mutableCopy];