openArchive

fnArchiveReader openArchive(string path, ReadOptions opts = ReadOptions.init)

Create a reader for an archive file.

Reads the entire file into memory, detects the format (if AUTO_DETECT), selects the best registered provider, and creates a reader instance.

Parameters

pathPath to the archive file.
optsRead options including format and password.

Returns

An ArchiveReader for the specified archive.

Throws

ArchiveError if the file cannot be read, format cannot be

detected, or no provider is registered.

fnArchiveReader openArchive(const(ubyte)[] data, ReadOptions opts = ReadOptions.init)

Create a reader from a byte slice.

Detects the format (if AUTO_DETECT), selects the best registered provider, and creates a reader instance.

Parameters

dataThe archive data as a byte slice.
optsRead options including format and password.

Returns

An ArchiveReader for the specified data.

Throws

ArchiveError if format cannot be detected or no provider

is registered for the format.

fnArchiveReader openArchive(Range)(Range source, ReadOptions opts = ReadOptions.init) if (isInputRange!Range && is(ElementType!Range : const(ubyte)[]))

Create a reader from an input range.

Reads all data from the range, then creates a reader.

Parameters

sourceInput range producing byte chunks.
optsRead options including format and password.

Returns

An ArchiveReader for the data from the range.

Throws

ArchiveError if format cannot be detected or no provider

is registered for the format.