Swiftpack.co - Package - apparata/Zipcode

Zipcode

Zipcode is a simple Swift framework for reading and writing zip files.

License

Zipcode is public domain. See UNLICENSE file for details.

Zipcode is based around zip which in turn is based on miniz. Both zip and miniz are public domain under the UNLICENSE license.

Examples

Printing the number of entries and the name of the entries in a zip file:

let archive = ZipArchive(path: "/tmp/Zipcode.zip")
try archive.read { reader in
    print("Number of entries: ", try reader.entryCount())
    let entries = try reader.entries()
    for entry in entries {
        print(entry.name)
    }
}

Unzipping an entry into memory:

let archive = ZipArchive(path: "/tmp/Zipcode.zip")
try archive.read { reader in
    let data = try reader.readEntryNamed("Zipcode/Package.swift")
    let string = String(data: data, encoding: .utf8) ?? "<Data is not a string>"
    print(string)
}

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

First release - 2020-03-13 23:32:03

Basic reading and writing of zip files have been implemented.