18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
+
-
-
-
-
+
+
+
+
|
#include "config.h"
#include <errno.h>
#import "OFTarArchive.h"
#import "OFTarArchiveEntry.h"
#import "OFTarArchiveEntry+Private.h"
#import "OFArchiveURIHandler.h"
#import "OFArchiveIRIHandler.h"
#import "OFDate.h"
#import "OFSeekableStream.h"
#import "OFStream.h"
#import "OFURI.h"
#import "OFURIHandler.h"
#import "OFIRI.h"
#import "OFIRIHandler.h"
#import "OFSeekableStream.h"
#import "OFStream.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotOpenException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
#import "OFWriteFailedException.h"
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
-
+
-
+
-
+
-
+
|
@synthesize encoding = _encoding;
+ (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode
{
return [[[self alloc] initWithStream: stream mode: mode] autorelease];
}
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode
+ (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode
{
return [[[self alloc] initWithURI: URI mode: mode] autorelease];
return [[[self alloc] initWithIRI: IRI mode: mode] autorelease];
}
+ (OFURI *)URIForFilePath: (OFString *)path inArchiveWithURI: (OFURI *)URI
+ (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI
{
return OFArchiveURIHandlerURIForFileInArchive(@"tar", path, URI);
return OFArchiveIRIHandlerIRIForFileInArchive(@"tar", path, IRI);
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
-
+
-
+
-
+
|
[self release];
@throw e;
}
return self;
}
- (instancetype)initWithURI: (OFURI *)URI mode: (OFString *)mode
- (instancetype)initWithIRI: (OFIRI *)IRI mode: (OFString *)mode
{
void *pool = objc_autoreleasePoolPush();
OFStream *stream;
@try {
if ([mode isEqual: @"a"])
stream = [OFURIHandler openItemAtURI: URI mode: @"r+"];
stream = [OFIRIHandler openItemAtIRI: IRI mode: @"r+"];
else
stream = [OFURIHandler openItemAtURI: URI mode: mode];
stream = [OFIRIHandler openItemAtIRI: IRI mode: mode];
} @catch (id e) {
[self release];
@throw e;
}
self = [self initWithStream: stream mode: mode];
|