archive.targz

$(DDOC_SECTIONS Type that implements the TarGz Filter used with the Archive template.

License:
.

Authors:
Richard W Laughlin Jr.

Source:


http:
//github.com/rcythr/archive

Filter class which can be used by the Archive class to compress/decompress files into a .gz format.

The only current available alias which uses this filter is the TarGzArchive.

Reading Usage:
import archive.targz;
import std.stdio;

auto archive = new TarGzArchive(std.file.read("my.tar.gz");

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

)


Writing Usage:
import archive.targz;

auto archive = new TarGzArchive();

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

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



class GzFilter;
Filter class which can be used by the Archive class to compress/decompress files into a .gz format.

static void[] compress(void[] data);
Input data is wrapped with gzip and returned.

static void[] decompress(void[] data);
Input data is processed to extract from the gzip format.

alias TarGzArchive = archive.core.Archive!(TarPolicy, GzFilter).Archive;
Convenience alias that simplifies the interface for users


Page generated by Ddoc. Copyright Richard W Laughlin Jr. 2014—2016