28 lines
1.4 KiB
Objective-C
28 lines
1.4 KiB
Objective-C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
#import <Foundation/Foundation.h>
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
FOUNDATION_EXPORT NSErrorDomain const VCCLibraryArchiveErrorDomain;
|
|
typedef NS_ERROR_ENUM(VCCLibraryArchiveErrorDomain, VCCLibraryArchiveError) {
|
|
VCCLibraryArchiveErrorInvalid = 1,
|
|
VCCLibraryArchiveErrorUnsupported,
|
|
VCCLibraryArchiveErrorUnsafePath,
|
|
VCCLibraryArchiveErrorCollision,
|
|
VCCLibraryArchiveErrorLimit,
|
|
VCCLibraryArchiveErrorCancelled,
|
|
VCCLibraryArchiveErrorIO
|
|
};
|
|
@interface VCCLibraryArchive : NSObject
|
|
// Synchronous worker API: call off the main thread. The destination must not
|
|
// exist; on failure only the new directory created by this call is removed.
|
|
// Returns regular-file relative paths. No links, executable permissions, or
|
|
// archive ownership/timestamps are restored. ZIP64/multi-volume ZIPs are rejected.
|
|
+ (nullable NSArray<NSString *> *)extractZIPAtURL:(NSURL *)archiveURL
|
|
toNewDirectory:(NSURL *)destinationURL
|
|
maximumExpandedBytes:(uint64_t)maximumExpandedBytes
|
|
maximumEntries:(NSUInteger)maximumEntries
|
|
shouldCancel:(BOOL (^ _Nullable)(void))shouldCancel
|
|
error:(NSError **)error
|
|
NS_SWIFT_NAME(extractZIP(at:toNewDirectory:maximumExpandedBytes:maximumEntries:shouldCancel:));
|
|
@end
|
|
NS_ASSUME_NONNULL_END
|