openArchive
fn
ArchiveReader 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
path | Path to the archive file. |
opts | Read 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.
fn
ArchiveReader 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
data | The archive data as a byte slice. |
opts | Read 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.
fn
ArchiveReader 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
source | Input range producing byte chunks. |
opts | Read 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.