@@ -312,11 +312,11 @@ { self = [super init]; @try { _compressionMethod = @"-lh0-"; - _date = [[OFDate alloc] initWithTimeIntervalSince1970: 0]; + _modificationDate = [[OFDate alloc] init]; } @catch (id e) { [self release]; @throw e; } @@ -354,11 +354,11 @@ case 1:; void *pool = objc_autoreleasePoolPush(); uint8_t fileNameLength; OFString *tmp; - _date = [parseMSDOSDate(date) retain]; + _modificationDate = [parseMSDOSDate(date) retain]; fileNameLength = [stream readInt8]; tmp = [stream readStringWithLength: fileNameLength encoding: encoding]; tmp = [tmp stringByReplacingOccurrencesOfString: @"\\" @@ -374,11 +374,11 @@ } objc_autoreleasePoolPop(pool); break; case 2: - _date = [[OFDate alloc] + _modificationDate = [[OFDate alloc] initWithTimeIntervalSince1970: date]; _CRC16 = [stream readLittleEndianInt16]; _operatingSystemIdentifier = [stream readInt8]; @@ -408,11 +408,11 @@ - (void)dealloc { [_compressionMethod release]; [_fileName release]; [_directoryName release]; - [_date release]; + [_modificationDate release]; [_fileComment release]; [_mode release]; [_UID release]; [_GID release]; [_owner release]; @@ -434,28 +434,27 @@ @try { [copy->_compressionMethod release]; copy->_compressionMethod = nil; - [copy->_date release]; - copy->_date = nil; + [copy->_modificationDate release]; + copy->_modificationDate = nil; copy->_directoryName = [_directoryName copy]; copy->_compressionMethod = [_compressionMethod copy]; copy->_compressedSize = _compressedSize; copy->_uncompressedSize = _uncompressedSize; - copy->_date = [_date copy]; + copy->_modificationDate = [_modificationDate copy]; copy->_headerLevel = _headerLevel; copy->_CRC16 = _CRC16; copy->_operatingSystemIdentifier = _operatingSystemIdentifier; copy->_fileComment = [_fileComment copy]; copy->_mode = [_mode retain]; copy->_UID = [_UID retain]; copy->_GID = [_GID retain]; copy->_owner = [_owner copy]; copy->_group = [_group copy]; - copy->_modificationDate = [_modificationDate retain]; copy->_extensions = [_extensions copy]; } @catch (id e) { [copy release]; @throw e; } @@ -484,13 +483,13 @@ - (uint32_t)uncompressedSize { return _uncompressedSize; } -- (OFDate *)date +- (OFDate *)modificationDate { - return _date; + return _modificationDate; } - (uint8_t)headerLevel { return _headerLevel; @@ -534,15 +533,10 @@ - (OFString *)group { return _group; } -- (OFDate *)modificationDate -{ - return _modificationDate; -} - - (OFArray OF_GENERIC(OFData *) *)extensions { return _extensions; } @@ -579,11 +573,12 @@ [data addItems: &tmp32 count: sizeof(tmp32)]; tmp32 = OFToLittleEndian32(_uncompressedSize); [data addItems: &tmp32 count: sizeof(tmp32)]; - tmp32 = OFToLittleEndian32((uint32_t)_date.timeIntervalSince1970); + tmp32 = OFToLittleEndian32( + (uint32_t)_modificationDate.timeIntervalSince1970); [data addItems: &tmp32 count: sizeof(tmp32)]; /* Reserved */ [data increaseCountBy: 1]; @@ -679,20 +674,10 @@ [data addItem: "\x53"]; [data addItems: [_owner cStringWithEncoding: encoding] count: ownerLength]; } - if (_modificationDate != nil) { - tmp16 = OFToLittleEndian16(7); - [data addItems: &tmp16 count: sizeof(tmp16)]; - [data addItem: "\x54"]; - - tmp32 = OFToLittleEndian32( - (uint32_t)_modificationDate.timeIntervalSince1970); - [data addItems: &tmp32 count: sizeof(tmp32)]; - } - for (OFData *extension in _extensions) { size_t extensionLength = extension.count; if (extension.itemSize != 1) @throw [OFInvalidArgumentException exception]; @@ -738,30 +723,29 @@ @"<%@:\n" @"\tFile name = %@\n" @"\tCompression method = %@\n" @"\tCompressed size = %" @PRIu32 "\n" @"\tUncompressed size = %" @PRIu32 "\n" - @"\tDate = %@\n" + @"\tModification date = %@\n" @"\tHeader level = %u\n" @"\tCRC16 = %04" @PRIX16 @"\n" @"\tOperating system identifier = %c\n" @"\tComment = %@\n" @"\tMode = %@\n" @"\tUID = %@\n" @"\tGID = %@\n" @"\tOwner = %@\n" @"\tGroup = %@\n" - @"\tModification date = %@\n" @"\tExtensions: %@" @">", self.class, self.fileName, _compressionMethod, _compressedSize, - _uncompressedSize, _date, _headerLevel, _CRC16, + _uncompressedSize, _modificationDate, _headerLevel, _CRC16, _operatingSystemIdentifier, _fileComment, mode, _UID, _GID, _owner, - _group, _modificationDate, extensions]; + _group, extensions]; [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } @end