Differences From Artifact [af4fea4ffc]:
- File
src/OFZIPArchive.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 13832) [annotate] [blame] [check-ins using]
To Artifact [4f8a23b8a4]:
- File
src/OFZIPArchive.m
— part of check-in
[f9cd4f9cab]
at
2017-06-05 15:51:48
on branch trunk
— OFStream: Don't throw when at end of stream
Instead, let reads return 0 and let writes append after the end. (user: js, size: 13823) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
33 34 35 36 37 38 39 40 41 | #import "crc32.h" #import "OFChecksumFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" | > < | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #import "crc32.h" #import "OFChecksumFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFNotOpenException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFSeekFailedException.h" #import "OFUnsupportedVersionException.h" /* * FIXME: Current limitations: * - Split archives are not supported. * - Write support is missing. |
︙ | ︙ | |||
73 74 75 76 77 78 79 | @interface OFZIPArchive_FileStream: OFStream { OFStream *_stream, *_decompressedStream; OFZIPArchive_LocalFileHeader *_localFileHeader; bool _hasDataDescriptor; uint64_t _size; uint32_t _CRC32; | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | @interface OFZIPArchive_FileStream: OFStream { OFStream *_stream, *_decompressedStream; OFZIPArchive_LocalFileHeader *_localFileHeader; bool _hasDataDescriptor; uint64_t _size; uint32_t _CRC32; bool _atEndOfStream; } - initWithStream: (OFStream *)path localFileHeader: (OFZIPArchive_LocalFileHeader *)localFileHeader; @end uint32_t |
︙ | ︙ | |||
489 490 491 492 493 494 495 | } return self; } - (void)dealloc { | > | | | | > > | 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | } return self; } - (void)dealloc { [self close]; [_decompressedStream release]; [_localFileHeader release]; [super dealloc]; } - (bool)lowlevelIsAtEndOfStream { return _atEndOfStream; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { size_t min, ret; if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; if (_atEndOfStream) return 0; if (_hasDataDescriptor) { if ([_decompressedStream isAtEndOfStream]) { uint32_t CRC32; _atEndOfStream = true; |
︙ | ︙ | |||
556 557 558 559 560 561 562 | _CRC32 = of_crc32(_CRC32, buffer, ret); return ret; } - (void)close { | > | | 559 560 561 562 563 564 565 566 567 568 569 570 571 | _CRC32 = of_crc32(_CRC32, buffer, ret); return ret; } - (void)close { [_stream release]; _stream = nil; [super close]; } @end |