70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode
{
return [[[self alloc] initWithURI: URI mode: mode] autorelease];
}
+ (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive
{
OFMutableURI *URI = [OFMutableURI URI];
void *pool = objc_autoreleasePoolPush();
OFCharacterSet *characterSet = [OFCharacterSet
of_URIPathAllowedCharacterSetWithoutExclamationMark];
OFString *archiveURI;
path = [path
stringByAddingPercentEncodingWithAllowedCharacters: characterSet];
archiveURI = [archive.string
stringByAddingPercentEncodingWithAllowedCharacters: characterSet];
URI.scheme = @"of-tar";
URI.percentEncodedPath = [OFString stringWithFormat: @"%@!%@",
archiveURI, path];
[URI makeImmutable];
objc_autoreleasePoolPop(pool);
return URI;
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode
{
return [[[self alloc] initWithURI: URI mode: mode] autorelease];
}
+ (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive
{
return OFURIForFileInArchive(@"of-tar", path, archive);
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
|