Import std.compress.zip
ZipWriter
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.
-
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
nameofdata, compressed bymethod, atlevel, or its default whenlevelis 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 atmodified, 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 ismode, or 644 when that's Null. Panics when thelevelisn't one ofmethod's, when themodeisn't from 0 to 0o7777, or when thenameis "", 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 atmodified, as Add's are, withmode, or 755 when that's Null. Panics when themodeisn't from 0 to 0o7777, or when thenameis "", holds a NUL or a '', or is longer than 65534 bytes. -
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.