Differences From Artifact [72c8a07e42]:
- File src/OFTarArchive.m — part of check-in [a06354b42a] at 2017-10-22 15:05:39 on branch trunk — Make Apple GCC with -Wshadow happy (user: js, size: 9448) [annotate] [blame] [check-ins using]
To Artifact [247f54af17]:
- File
src/OFTarArchive.m
— part of check-in
[69749b6a5b]
at
2017-11-19 11:04:22
on branch trunk
— Do not conform to OFReadyFor*Observing by default
Instead of letting OFStream conform to it, which itself does not really
conform to it, let all the subclasses that actually do conform to it. (user: js, size: 9581) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
29 30 31 32 33 34 35 | #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFWriteFailedException.h" | | | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotOpenException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
#import "OFWriteFailedException.h"
@interface OFTarArchive_FileReadStream: OFStream <OFReadyForReadingObserving>
{
OFTarArchiveEntry *_entry;
OF_KINDOF(OFStream *) _stream;
uint64_t _toRead;
bool _atEndOfStream;
}
- (instancetype)initWithStream: (OFStream *)stream
entry: (OFTarArchiveEntry *)entry;
- (void)of_skip;
@end
@interface OFTarArchive_FileWriteStream: OFStream <OFReadyForWritingObserving>
{
OFTarArchiveEntry *_entry;
OF_KINDOF(OFStream *) _stream;
uint64_t _toWrite;
}
- (instancetype)initWithStream: (OFStream *)stream
entry: (OFTarArchiveEntry *)entry;
@end
|
| ︙ | ︙ | |||
199 200 201 202 203 204 205 | _lastReturnedStream = [[OFTarArchive_FileReadStream alloc] initWithStream: _stream entry: entry]; return entry; } | | > | | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
_lastReturnedStream = [[OFTarArchive_FileReadStream alloc]
initWithStream: _stream
entry: entry];
return entry;
}
- (OFStream <OFReadyForReadingObserving> *)streamForReadingCurrentEntry
{
if (_mode != OF_TAR_ARCHIVE_MODE_READ)
@throw [OFInvalidArgumentException exception];
if (_lastReturnedStream == nil)
@throw [OFInvalidArgumentException exception];
return [[_lastReturnedStream retain] autorelease];
}
- (OFStream <OFReadyForWritingObserving> *)
streamForWritingEntry: (OFTarArchiveEntry *)entry
{
void *pool;
if (_mode != OF_TAR_ARCHIVE_MODE_WRITE &&
_mode != OF_TAR_ARCHIVE_MODE_APPEND)
@throw [OFInvalidArgumentException exception];
|
| ︙ | ︙ |