ObjFW  Diff

Differences From Artifact [859f5b3b09]:

To Artifact [0dbf94ce58]:


19
20
21
22
23
24
25

26
27
28
29
30
31
32
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33







+








#import "OFTarArchive.h"
#import "OFTarArchiveEntry.h"
#import "OFTarArchiveEntry+Private.h"
#import "OFDate.h"
#import "OFSeekableStream.h"
#import "OFStream.h"
#import "OFURI.h"
#import "OFURIHandler.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotOpenException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
66
67
68
69
70
71
72
























73
74
75
76
77
78
79
67
68
69
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
104







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







	return [[[self alloc] initWithStream: stream mode: mode] autorelease];
}

+ (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
}

- (instancetype)initWithStream: (OFStream *)stream mode: (OFString *)mode