archive.zip

Functions and Types that implement the Zip Policy used with the Archive template.

Members

Aliases

ZipArchive
alias ZipArchive = Archive!ZipPolicy

Convenience alias that simplifies the interface for users

Classes

ZipException
class ZipException

Thrown when a zip file is not readable or contains errors.

ZipPolicy
class ZipPolicy

Policy class for reading and writing zip archives.

Enums

CompressionMethod
enum CompressionMethod

Specifies the compression for a particular zip entry.

Meta

Source

See Source File
http://github.com/rcythr/archive

Policy for the Archive template which provides reading and writing of Zip files.

Reading Usage:

import archive.zip;
import std.stdio;

auto archive = new ZipArchive(std.file.read("my.zip");

foreach(file; archive.files)
{
    writeln("Filename: ", file.path);
    writeln("Data: ", file.data);
}

Writing Usage:

import archive.zip;

auto archive = new ZipArchive();

auto file = new ZipArchive.File("languages/awesome.txt");
file.data = "D\n"; // can also set to immutable(ubyte)[]
archive.addFile(file);

std.file.write("lang.zip", cast(ubyte[])archive.serialize());

Authors

Refactored into Policy by Richard W Laughlin Jr. Original zip code by Walter Bright