Commit 26b48168 authored by Jake's avatar Jake

Fix compiler errors for beta 6

parent db76c1bf
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F3707899-72AE-49DA-9BDD-5CB0B64CF03A", "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F3707899-72AE-49DA-9BDD-5CB0B64CF03A",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"8DA5B175D3FDB92A3B3CCBD4109A734F1316A3DD" : "Zip\/Zip\/minizip\/", "8DA5B175D3FDB92A3B3CCBD4109A734F1316A3DD" : "Zip\/Zip\/minizip\/",
"3DD768C8AB2D6A2647C9EF99992D3CC5820E77C4" : "Zip-swift3\/" "3DD768C8AB2D6A2647C9EF99992D3CC5820E77C4" : "Zip\/"
}, },
"DVTSourceControlWorkspaceBlueprintNameKey" : "Zip", "DVTSourceControlWorkspaceBlueprintNameKey" : "Zip",
"DVTSourceControlWorkspaceBlueprintVersion" : 204, "DVTSourceControlWorkspaceBlueprintVersion" : 204,
......
...@@ -37,7 +37,7 @@ extension Zip { ...@@ -37,7 +37,7 @@ extension Zip {
- returns: NSURL of the destination folder. - returns: NSURL of the destination folder.
*/ */
public class func quickUnzipFile(_ path: URL, progress: ((progress: Double) -> ())?) throws -> URL { public class func quickUnzipFile(_ path: URL, progress: ((_ progress: Double) -> ())?) throws -> URL {
let fileManager = FileManager.default let fileManager = FileManager.default
let fileExtension = path.pathExtension let fileExtension = path.pathExtension
...@@ -85,10 +85,10 @@ extension Zip { ...@@ -85,10 +85,10 @@ extension Zip {
- returns: NSURL of the destination folder. - returns: NSURL of the destination folder.
*/ */
public class func quickZipFiles(_ paths: [URL], fileName: String, progress: ((progress: Double) -> ())?) throws -> URL { public class func quickZipFiles(_ paths: [URL], fileName: String, progress: ((_ progress: Double) -> ())?) throws -> URL {
let fileManager = FileManager.default let fileManager = FileManager.default
let documentsUrl = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] as URL let documentsUrl = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] as URL
let destinationUrl = try! documentsUrl.appendingPathComponent("\(fileName).zip") let destinationUrl = documentsUrl.appendingPathComponent("\(fileName).zip")
try self.zipFiles(paths, zipFilePath: destinationUrl, password: nil, progress: progress) try self.zipFiles(paths, zipFilePath: destinationUrl, password: nil, progress: progress)
return destinationUrl return destinationUrl
} }
......
...@@ -62,7 +62,7 @@ public class Zip { ...@@ -62,7 +62,7 @@ public class Zip {
- notes: Supports implicit progress composition - notes: Supports implicit progress composition
*/ */
public class func unzipFile(_ zipFilePath: URL, destination: URL, overwrite: Bool, password: String?, progress: ((progress: Double) -> ())?) throws { public class func unzipFile(_ zipFilePath: URL, destination: URL, overwrite: Bool, password: String?, progress: ((_ progress: Double) -> ())?) throws {
// File manager // File manager
let fileManager = FileManager.default let fileManager = FileManager.default
...@@ -112,7 +112,7 @@ public class Zip { ...@@ -112,7 +112,7 @@ public class Zip {
throw ZipError.unzipFail throw ZipError.unzipFail
} }
var fileInfo = unz_file_info64() var fileInfo = unz_file_info64()
memset(&fileInfo, 0, sizeof(unz_file_info.self)) memset(&fileInfo, 0, MemoryLayout<unz_file_info>.size)
ret = unzGetCurrentFileInfo64(zip, &fileInfo, nil, 0, nil, 0, nil, 0) ret = unzGetCurrentFileInfo64(zip, &fileInfo, nil, 0, nil, 0, nil, 0)
if ret != UNZ_OK { if ret != UNZ_OK {
unzCloseCurrentFile(zip) unzCloseCurrentFile(zip)
...@@ -179,7 +179,7 @@ public class Zip { ...@@ -179,7 +179,7 @@ public class Zip {
// Update progress handler // Update progress handler
if let progressHandler = progress{ if let progressHandler = progress{
progressHandler(progress: (currentPosition/totalSize)) progressHandler((currentPosition/totalSize))
} }
progressTracker.completedUnitCount = Int64(currentPosition) progressTracker.completedUnitCount = Int64(currentPosition)
...@@ -188,7 +188,7 @@ public class Zip { ...@@ -188,7 +188,7 @@ public class Zip {
// Completed. Update progress handler. // Completed. Update progress handler.
if let progressHandler = progress{ if let progressHandler = progress{
progressHandler(progress: 1.0) progressHandler(1.0)
} }
progressTracker.completedUnitCount = Int64(totalSize) progressTracker.completedUnitCount = Int64(totalSize)
...@@ -209,7 +209,7 @@ public class Zip { ...@@ -209,7 +209,7 @@ public class Zip {
- notes: Supports implicit progress composition - notes: Supports implicit progress composition
*/ */
public class func zipFiles(_ paths: [URL], zipFilePath: URL, password: String?, progress: ((progress: Double) -> ())?) throws { public class func zipFiles(_ paths: [URL], zipFilePath: URL, password: String?, progress: ((_ progress: Double) -> ())?) throws {
// File manager // File manager
let fileManager = FileManager.default let fileManager = FileManager.default
...@@ -291,7 +291,7 @@ public class Zip { ...@@ -291,7 +291,7 @@ public class Zip {
// Update progress handler // Update progress handler
if let progressHandler = progress{ if let progressHandler = progress{
progressHandler(progress: (currentPosition/totalSize)) progressHandler((currentPosition/totalSize))
} }
progressTracker.completedUnitCount = Int64(currentPosition) progressTracker.completedUnitCount = Int64(currentPosition)
...@@ -305,7 +305,7 @@ public class Zip { ...@@ -305,7 +305,7 @@ public class Zip {
// Completed. Update progress handler. // Completed. Update progress handler.
if let progressHandler = progress{ if let progressHandler = progress{
progressHandler(progress: 1.0) progressHandler(1.0)
} }
progressTracker.completedUnitCount = Int64(totalSize) progressTracker.completedUnitCount = Int64(totalSize)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment