ObjFW  Diff

Differences From Artifact [9bc5b44666]:

To Artifact [e14841e9db]:


18
19
20
21
22
23
24
25

26


27
28
29
30
31
32
33
34
35
36
37
38
39
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32


33
34
35
36
37
38
39







-
+

+
+




-
-







#include "config.h"

#include <errno.h>

#import "OFLHAArchive.h"
#import "OFLHAArchiveEntry.h"
#import "OFLHAArchiveEntry+Private.h"
#import "OFArchiveURIHandler.h"
#import "OFArchiveIRIHandler.h"
#import "OFCRC16.h"
#import "OFIRI.h"
#import "OFIRIHandler.h"
#import "OFLHADecompressingStream.h"
#import "OFSeekableStream.h"
#import "OFStream.h"
#import "OFString.h"
#import "OFURI.h"
#import "OFURIHandler.h"

#import "OFChecksumMismatchException.h"
#import "OFInvalidArgumentException.h"
#import "OFNotImplementedException.h"
#import "OFNotOpenException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
84
85
86
87
88
89
90
91

92
93

94
95
96

97
98

99
100
101
102
103
104
105
84
85
86
87
88
89
90

91
92

93
94
95

96
97

98
99
100
101
102
103
104
105







-
+

-
+


-
+

-
+







@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(@"lha", path, URI);
	return OFArchiveIRIHandlerIRIForFileInArchive(@"lha", path, IRI);
}

- (instancetype)init
{
	OF_INVALID_INIT_METHOD
}

132
133
134
135
136
137
138
139

140
141
142
143
144
145
146

147
148

149
150
151
152
153
154
155
132
133
134
135
136
137
138

139
140
141
142
143
144
145

146
147

148
149
150
151
152
153
154
155







-
+






-
+

-
+







		[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];