@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -63,22 +63,25 @@ { if (self == [GZIPArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding -{ - return [[[self alloc] initWithStream: stream - mode: mode - encoding: encoding] autorelease]; -} - -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding ++ (instancetype)archiveWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding +{ + return [[[self alloc] initWithPath: path + stream: stream + mode: mode + encoding: encoding] autorelease]; +} + +- (instancetype)initWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { self = [super init]; @try { _stream = [[OFGZIPStream alloc] initWithStream: stream @@ -109,12 +112,12 @@ { OFString *fileName; OFFile *output; if (files.count != 0) { - [OFStdErr writeLine: - OF_LOCALIZED(@"cannot_extract_specific_file_from_gz", + [OFStdErr writeLine: OF_LOCALIZED( + @"cannot_extract_specific_file_from_gz", @"Cannot extract a specific file of a .gz archive!")]; app->_exitStatus = 1; return; }