zip

Generated by tinox doc

tinox.core.zip, split out of the bundled stdlib as a standalone tinox-central package.

Create and extract

import tinox.core.zip

class Main
{
    fnc main() -> Int32
    {
        const archive: ZipArchive = Zip::create("/tmp/example.zip")
        Zip::addFile(archive, "hello.txt", "Hello, ZIP!")

        const reopened: ZipArchive = Zip::open("/tmp/example.zip")
        println(reopened.entries.len().toString())
        println(Zip::extractFile(reopened, "hello.txt"))

        Zip::close(reopened)
        return 0
    }
}

fn zipEntryCount(path: String) → Int64

fn zipEntryName(path: String, idx: Int64) → String

fn zipEntrySize(path: String, idx: Int64) → Int64

fn zipExtractFile(path: String, name: String) → String

fn zipAddFile(path: String, name: String, content: String) → Nothing

fn zipRemoveFile(path: String, name: String) → Nothing

class Zip

Methods

fn open(path: String) → ZipArchive
fn create(path: String) → ZipArchive
fn listEntries(path: String) → List<ZipEntry>
fn extractFile(archive: ZipArchive, entryName: String) → String
fn addFile(archive: ZipArchive, name: String, content: String) → Nothing
fn removeFile(archive: ZipArchive, entryName: String) → Nothing
fn close(archive: ZipArchive) → Nothing

class ZipArchive

Fields

pathString
entriesList<ZipEntry>

class ZipEntry

Fields

nameString
sizeInt64