2016-07-05 15:12:27 -04:00
|
|
|
//
|
|
|
|
|
// SSZipArchive+Swift.swift
|
|
|
|
|
// ZipArchive
|
|
|
|
|
//
|
|
|
|
|
// Created by William Dunay on 7/6/16.
|
|
|
|
|
// Copyright © 2016 smumryak. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
extension SSZipArchive {
|
|
|
|
|
|
2016-09-12 21:43:20 +01:00
|
|
|
static func unzipFileAtPath(_ path: String, toDestination destination: String, overwrite: Bool, password: String?, delegate: SSZipArchiveDelegate?) throws -> Bool {
|
2016-07-05 15:12:27 -04:00
|
|
|
|
|
|
|
|
var success = false
|
|
|
|
|
var error: NSError?
|
|
|
|
|
|
2016-09-12 21:43:20 +01:00
|
|
|
success = __unzipFile(atPath: path, toDestination: destination, overwrite: overwrite, password: password, error: &error, delegate: delegate)
|
2016-07-05 15:12:27 -04:00
|
|
|
if let throwableError = error {
|
|
|
|
|
throw throwableError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return success
|
|
|
|
|
}
|
|
|
|
|
}
|