Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
Zip
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
YongYue
Zip
Commits
6e16483d
Commit
6e16483d
authored
Jul 23, 2017
by
Roy Marmelstein
Committed by
GitHub
Jul 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #89 from piemonte/master
unzip file handler support
parents
4a15a786
3e33d0df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
Zip/Zip.swift
Zip/Zip.swift
+6
-1
No files found.
Zip/Zip.swift
View file @
6e16483d
...
...
@@ -82,7 +82,7 @@ public class Zip {
- 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
)
->
())?
=
nil
,
fileOutputHandler
:
((
_
unzippedFile
:
URL
)
->
Void
)?
=
nil
)
throws
{
// File manager
let
fileManager
=
FileManager
.
default
...
...
@@ -218,6 +218,11 @@ public class Zip {
progressHandler
((
currentPosition
/
totalSize
))
}
if
let
fileHandler
=
fileOutputHandler
,
let
fileUrl
=
URL
(
string
:
fullPath
)
{
fileHandler
(
fileUrl
)
}
progressTracker
.
completedUnitCount
=
Int64
(
currentPosition
)
}
while
(
ret
==
UNZ_OK
&&
ret
!=
UNZ_END_OF_LIST_OF_FILE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment