Skip to content

Instantly share code, notes, and snippets.

@EricRabil
Created July 24, 2022 02:20
Show Gist options
  • Save EricRabil/4f80a3b11f68d436bfa6d7645ecb2264 to your computer and use it in GitHub Desktop.
Save EricRabil/4f80a3b11f68d436bfa6d7645ecb2264 to your computer and use it in GitHub Desktop.
import ERWeakLink
@objc protocol SZExtractorDelegate: NSObjectProtocol {
@objc(setExtractionProgress:) func progress(changedTo percent: Double)
@objc(extractionCompleteAtArchivePath:) func extraction(completedAt archivePath: String)
@objc(extractionEnteredPassThroughMode) func extractionEnteredPassThroughMode()
}
typealias SZExtractorPrepCompletion = @convention(block) (UInt64, NSError?) -> ()
typealias SZExtractorStreamCompletion = @convention(block) (NSError?, Bool) -> ()
typealias SZExtractorFinishCompletion = @convention(block) (NSError?) -> ()
@objc protocol SZExtractor: NSObjectProtocol {
@objc var extractorDelegate: SZExtractorDelegate? { get set }
@objc(initWithPath:options:) init(path: String, options: NSDictionary?)
@objc(initWithOptions:) init(options: NSDictionary?)
@objc(initForLocalExtractionWithPath:options:resumptionOffset:) init(localPath: String, options: NSDictionary?, resumptionOffset: UInt64)
@objc(prepareForExtraction:) func prepare(_ completion: @escaping SZExtractorPrepCompletion)
@objc(prepareForExtractionToPath:completionBlock:) func prepare(path: String, _ completion: @escaping SZExtractorPrepCompletion)
@objc var extractionPath: String? { get }
@objc var options: NSDictionary? { get }
@objc(supplyBytes:withCompletionBlock:) func supply(bytes: Data, _ completion: @escaping SZExtractorStreamCompletion)
@objc(finishStreamWithCompletionBlock:) func finish(_ completion: @escaping SZExtractorFinishCompletion)
@objc(terminateStreamWithError:completionBlock:) func terminate(with error: Error, _ completion: @escaping SZExtractorFinishCompletion)
}
let SZExtractor$: SZExtractor.Type = ERWeakLinkObjC("SZExtractor", .privateFramework("StreamingZip"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment