ObjFW  Diff

Differences From Artifact [0352ca14b6]:

  • File utils/ofzip/GZIPArchive.m — part of check-in [ebf74827f6] at 2017-02-26 21:29:13 on branch trunk — Localize ofzip (user: js size: 3578)

To Artifact [b72f242916]:

  • File utils/ofzip/GZIPArchive.m — part of check-in [4af49a13c3] at 2017-05-07 20:10:13 on branch trunk — Small code style change Casts are now written like types in variable declarations. (user: js size: 3585)

41
42
43
44
45
46
47
48

49
50
51

52
53
54
55
56

57
58
59
60
61
62
63
41
42
43
44
45
46
47

48
49
50

51
52
53
54
55

56
57
58
59
60
61
62
63







-
+


-
+




-
+







#endif
}

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

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

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

	@try {
		_stream = [[OFGZIPStream alloc] initWithStream: stream];
	} @catch (id e) {
		[self release];
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91







-
+







- (void)listFiles
{
	[of_stderr writeLine: OF_LOCALIZED(@"cannot_list_gz",
	    @"Cannot list files of a .gz archive!")];
	app->_exitStatus = 1;
}

- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files
- (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files
{
	OFString *fileName;
	OFFile *output;

	if ([files count] != 0) {
		[of_stderr writeLine:
		    OF_LOCALIZED(@"cannot_extract_specific_file_from_gz",
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139







-
+







		[of_stdout writeString: @"\r"];
		[of_stdout writeLine: OF_LOCALIZED(@"extracting_file_done",
		    @"Extracting %[file]... done",
		    @"file", fileName)];
	}
}

- (void)printFiles: (OFArray OF_GENERIC(OFString*)*)files
- (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files
{
	OFString *fileName = [[app->_archivePath lastPathComponent]
	    stringByDeletingPathExtension];

	if ([files count] > 0) {
		[of_stderr writeLine: OF_LOCALIZED(
		    @"cannot_print_specific_file_from_gz",