21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import "OFCharacterSet.h"
#import "OFGZIPStream.h"
#import "OFIRI.h"
#import "OFLHAArchive.h"
#import "OFStream.h"
#import "OFTarArchive.h"
#import "OFZIPArchive.h"
#import "OFInvalidArgumentException.h"
#import "OFOpenItemFailedException.h"
@interface OFArchiveIRIHandlerPathAllowedCharacterSet: OFCharacterSet
{
OFCharacterSet *_characterSet;
|
>
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#import "OFCharacterSet.h"
#import "OFGZIPStream.h"
#import "OFIRI.h"
#import "OFLHAArchive.h"
#import "OFStream.h"
#import "OFTarArchive.h"
#import "OFZIPArchive.h"
#import "OFZooArchive.h"
#import "OFInvalidArgumentException.h"
#import "OFOpenItemFailedException.h"
@interface OFArchiveIRIHandlerPathAllowedCharacterSet: OFCharacterSet
{
OFCharacterSet *_characterSet;
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
mode: mode
errNo: ENOENT];
} else if ([scheme isEqual: @"zip"]) {
OFZIPArchive *archive = [OFZIPArchive archiveWithIRI: archiveIRI
mode: @"r"];
stream = [archive streamForReadingFile: path];
} else
@throw [OFInvalidArgumentException exception];
end:
stream = [stream retain];
objc_autoreleasePoolPop(pool);
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
mode: mode
errNo: ENOENT];
} else if ([scheme isEqual: @"zip"]) {
OFZIPArchive *archive = [OFZIPArchive archiveWithIRI: archiveIRI
mode: @"r"];
stream = [archive streamForReadingFile: path];
} else if ([scheme isEqual: @"zoo"]) {
OFZooArchive *archive = [OFZooArchive archiveWithIRI: archiveIRI
mode: @"r"];
OFZooArchiveEntry *entry;
while ((entry = [archive nextEntry]) != nil) {
if ([entry.fileName isEqual: path]) {
stream = [archive streamForReadingCurrentEntry];
goto end;
}
}
@throw [OFOpenItemFailedException exceptionWithIRI: IRI
mode: mode
errNo: ENOENT];
} else
@throw [OFInvalidArgumentException exception];
end:
stream = [stream retain];
objc_autoreleasePoolPop(pool);
|