Differences From Artifact [e8d94333d8]:
- File
src/OFLHAArchiveEntry.m
— part of check-in
[5c4470fb42]
at
2018-05-27 00:48:16
on branch trunk
— OFLHAArchiveEntry: Improve directory name parsing
This now works with UTF-8 encoded directory names. (user: js, size: 10260) [annotate] [blame] [check-ins using]
To Artifact [596d16c180]:
- File
src/OFLHAArchiveEntry.m
— part of check-in
[1a6e3816c1]
at
2018-05-27 07:32:22
on branch trunk
— OFLHAArchiveEntry: Keep the method as a string
It is only necessary to extract files, so it makes sense to keep it as
is to be able to list files using an unknown method. (user: js, size: 9089) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
245 246 247 248 249 250 251 | if (headerSize < 21) @throw [OFInvalidFormatException exception]; [stream readIntoBuffer: header exactLength: 20]; | < < < < < < < < < < < < < < < < < < < < < < < < < | | | | < < < < | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | if (headerSize < 21) @throw [OFInvalidFormatException exception]; [stream readIntoBuffer: header exactLength: 20]; _method = [[OFString alloc] initWithCString: header + 1 encoding: OF_STRING_ENCODING_ASCII length: 5]; memcpy(&_compressedSize, header + 6, 4); _compressedSize = OF_BSWAP32_IF_BE(_compressedSize); memcpy(&_uncompressedSize, header + 10, 4); _uncompressedSize = OF_BSWAP32_IF_BE(_uncompressedSize); |
︙ | ︙ | |||
329 330 331 332 333 334 335 336 337 338 339 340 341 342 | } return self; } - (void)dealloc { [_fileName release]; [_directoryName release]; [_date release]; [_fileComment release]; [_mode release]; [_UID release]; [_GID release]; | > | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | } return self; } - (void)dealloc { [_method release]; [_fileName release]; [_directoryName release]; [_date release]; [_fileComment release]; [_mode release]; [_UID release]; [_GID release]; |
︙ | ︙ | |||
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | : [OFString stringWithFormat: @"%" PRIo16, [_mode uInt16Value]]); OFString *extensions = [[_extensions description] stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tCompressed size = %" @PRIu32 "\n" @"\tUncompressed size = %" @PRIu32 "\n" @"\tDate = %@\n" @"\tLevel = %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: %@" @">", | > | > | | | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | : [OFString stringWithFormat: @"%" PRIo16, [_mode uInt16Value]]); OFString *extensions = [[_extensions description] stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tMethod = %@\n" @"\tCompressed size = %" @PRIu32 "\n" @"\tUncompressed size = %" @PRIu32 "\n" @"\tDate = %@\n" @"\tLevel = %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], _method, _compressedSize, _uncompressedSize, _date, _level, _CRC16, _operatingSystemIdentifier, _fileComment, mode, _UID, _GID, _owner, _group, _modificationDate, extensions]; [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } @end |