Structureswift-package-manager 6.0.3Basics
UniversalArchiver
An Archiver
that handles multiple formats by delegating to other existing archivers each dedicated to its own format.
struct UniversalArchiver
An Archiver
that handles multiple formats by delegating to other existing archivers each dedicated to its own format.
struct UniversalArchiver
import Basics
protocol Archiver : Sendable
The Archiver
protocol abstracts away the different operations surrounding archives.
protocol Sendable
init(_ fileSystem: any FileSystem, _ cancellator: Cancellator? = nil)
let supportedExtensions: Set<String>
func compress(directory: AbsolutePath, to destinationPath: AbsolutePath, completion: @escaping (Result<Void, Swift.Error>) -> Void)
func extract(from archivePath: AbsolutePath, to destinationPath: AbsolutePath, completion: @escaping (Result<Void, Swift.Error>) -> Void)
func validate(path: AbsolutePath, completion: @escaping (Result<Bool, Swift.Error>) -> Void)
func compress(directory: AbsolutePath, to destinationPath: AbsolutePath) async throws
Asynchronously compresses the contents of a directory to a destination archive.
func extract(from archivePath: AbsolutePath, to destinationPath: AbsolutePath) async throws
Asynchronously extracts the contents of an archive to a destination folder.
func isFileSupported(_ lastPathComponent: String) -> Bool
func validate(path: AbsolutePath) async throws -> Bool
Asynchronously validates if a file is an archive.