Skip to content
FutureBlitz

    Install

    Import std.compress.zip

    ZipWriter

    std.compress.zip

    class

    Public Class ZipWriter

    A new zip, an entry at a time: Add puts in a file, AddFolder a folder, and Finish gives the zip and starts again, empty.

    std/compress/zip.fb, line 92

    • Public New() constructor #

      A new ZipWriter, with no entries.

    • @PanicsAtCaller Public Method Add(name: String, data: UInt8[], method: ZipMethod = ZipMethod.DEFLATE, level: Int? = Null, modified: Timestamp? = Null, mode: Int? = Null) method #

      Adds a file named name of data, compressed by method, at level, or its default when level is Null: 6 for DEFLATE, from 0 to 9, and for LZMA and XZ, which a zip has from 1 to 9, as minizip-ng stores an entry at 0, and 3 for ZSTD, from 1 to 22. It was last changed at modified, or on 1980-01-01 when that's Null, a DOS date of an even second from 1980 to 2107, which one from 1970 to 2106 is exact to the second beside, and its mode is mode, or 644 when that's Null. Panics when the level isn't one of method's, when the mode isn't from 0 to 0o7777, or when the name is "", holds a NUL or a '', ends with '/', as a folder's does, or is longer than 65535 bytes.

    • @PanicsAtCaller Public Method AddFolder(name: String, modified: Timestamp? = Null, mode: Int? = Null) method #

      Adds a folder named name, with '/' after it unless it has one, which takes 1 of a name's 65535 bytes, last changed at modified, as Add's are, with mode, or 755 when that's Null. Panics when the mode isn't from 0 to 0o7777, or when the name is "", holds a NUL or a '', or is longer than 65534 bytes.

    • @PanicsAtCaller Public Method Finish(): UInt8[] method #

      The zip, of the entries added since it started, and then it starts again, empty. Panics when it's more bytes than a UInt8[] holds.

    Report an issue with this page or with FutureBlitz on GitHub.