wavelength 1.0.0
Loading...
Searching...
No Matches
Tools::Ark::ArkWriter Class Reference

Writer of a version 2 archive from the files below a directory. More...

#include <arkwriter.h>

Static Public Member Functions

static std::expected< std::size_t, Error > write (const std::filesystem::path &root, const std::vector< std::string > &order, const std::filesystem::path &output)
 Write the archive.

Detailed Description

Writer of a version 2 archive from the files below a directory.

Each file is stored at its path relative to the directory. The names of the directories and of the files share one string block and one hash table, with a slot for each name the game's HashString gives, or the next free slot. The data follows the directory without padding. A gzip file records the size from its trailer as its inflated size.

Member Function Documentation

◆ write()

std::expected< std::size_t, Error > Tools::Ark::ArkWriter::write ( const std::filesystem::path & root,
const std::vector< std::string > & order,
const std::filesystem::path & output )
static

Write the archive.

Parameters
rootDirectory with the files.
orderPaths to place first, in order. A path missing from the directory is skipped, and the remaining files follow in byte order of their paths.
outputThe archive to write.
Returns
The number of files, or an error when a path is not representable, a file cannot be read, the archive passes 2 GiB, or the output cannot be written.

The documentation for this class was generated from the following file: