ObjFW  Diff

Differences From Artifact [68a00e534e]:

To Artifact [969975ba2f]:


55
56
57
58
59
60
61


62
63
64
65
66
67
68
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70







+
+







}

- (instancetype)initWithStream: (OFStream *)stream
			 entry: (OFTarArchiveEntry *)entry;
@end

@implementation OFTarArchive: OFObject
@synthesize encoding = _encoding;

+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream
			     mode: (OFString *)mode
{
	return [[[self alloc] initWithStream: stream
					mode: mode] autorelease];
}

113
114
115
116
117
118
119


120
121
122
123
124
125
126
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130







+
+








			if (!empty)
				@throw [OFInvalidFormatException exception];

			[stream seekToOffset: -1024
				      whence: SEEK_END];
		}

		_encoding = OF_STRING_ENCODING_UTF_8;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}
191
192
193
194
195
196
197
198


199
200
201
202
203
204
205
195
196
197
198
199
200
201

202
203
204
205
206
207
208
209
210







-
+
+







			if (buffer.u32[i] != 0)
				@throw [OFInvalidFormatException exception];

		return nil;
	}

	entry = [[[OFTarArchiveEntry alloc]
	    of_initWithHeader: buffer.c] autorelease];
	    of_initWithHeader: buffer.c
		     encoding: _encoding] autorelease];

	_lastReturnedStream = [[OFTarArchive_FileReadStream alloc]
	    initWithStream: _stream
		     entry: entry];

	return entry;
}
226
227
228
229
230
231
232
233


234
235
236
237
238
239
240
231
232
233
234
235
236
237

238
239
240
241
242
243
244
245
246







-
+
+








	pool = objc_autoreleasePoolPush();

	[_lastReturnedStream close];
	[_lastReturnedStream release];
	_lastReturnedStream = nil;

	[entry of_writeToStream: _stream];
	[entry of_writeToStream: _stream
		       encoding: _encoding];

	_lastReturnedStream = [[OFTarArchive_FileWriteStream alloc]
	    initWithStream: _stream
		     entry: entry];

	objc_autoreleasePoolPop(pool);