ObjFW  Diff

Differences From Artifact [01768df2ad]:

  • File utils/ofzip/ZIPArchive.m — part of check-in [22a6ad346c] at 2017-08-02 20:04:10 on branch trunk — OFZIPArchive: Prepare for adding write support (user: js size: 9682)

To Artifact [4d9fbe54f7]:

  • File utils/ofzip/ZIPArchive.m — part of check-in [41949ecc65] at 2017-08-05 17:48:55 on branch trunk — ofzip: Support for writing files Not supported for any file formats, yet. (user: js size: 9752)

53
54
55
56
57
58
59

60
61


62
63
64

65
66
67
68
69

70
71

72
73
74
75
76
77
78
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
70
71

72


73
74
75
76
77
78
79
80







+

-
+
+



+




-
+
-
-
+







+ (void)initialize
{
	if (self == [ZIPArchive class])
		app = (OFZIP *)[[OFApplication sharedApplication] delegate];
}

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

- initWithStream: (OF_KINDOF(OFStream *))stream
	    mode: (OFString *)mode
{
	self = [super init];

	@try {
		_archive = [[OFZIPArchive alloc]
		_archive = [[OFZIPArchive alloc] initWithSeekableStream: stream
		    initWithSeekableStream: stream
				      mode: @"r"];
								   mode: mode];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}