Skip to content

Commit

Permalink
Fix API breakage and C files compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Aug 26, 2024
1 parent 2e58c14 commit 361ed1d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Minizip/crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <bsd/stdlib.h>
#include <stdint.h>
#include <time.h>

Expand Down
32 changes: 32 additions & 0 deletions Sources/Zip/QuickZip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ extension Zip {
.documentDirectory
#endif
}

/**
Quickly unzips a file.

Unzips to a new folder inside the app's documents folder with the zip file's name.

- Parameter path: Path of zipped file.

- Throws: `ZipError.unzipFail` if unzipping fails or `ZipError.fileNotFound` if file is not found.

- Returns: `URL` of the destination folder.
*/
public class func quickUnzipFile(_ path: URL) throws -> URL {
return try quickUnzipFile(path, progress: nil)
}

/**
Quickly unzips a file.
Expand All @@ -42,6 +57,23 @@ extension Zip {
try self.unzipFile(path, destination: destinationUrl, overwrite: true, password: nil, progress: progress)
return destinationUrl
}

/**
Quickly zips files.

- Parameters:
- paths: Array of `URL` filepaths.
- fileName: File name for the resulting zip file.

- Throws: `ZipError.zipFail` if zipping fails.

> Note: Supports implicit progress composition.

- Returns: `URL` of the destination folder.
*/
public class func quickZipFiles(_ paths: [URL], fileName: String) throws -> URL {
return try quickZipFiles(paths, fileName: fileName, progress: nil)
}

/**
Quickly zips files.
Expand Down

0 comments on commit 361ed1d

Please sign in to comment.