Skip to main content

write_erf_with_options

Function write_erf_with_options 

Source
pub fn write_erf_with_options<W: Write>(
    writer: &mut W,
    erf: &Erf,
    options: ErfWriteOptions,
) -> Result<(), ErfBinaryError>
Expand description

Writes an ERF/MOD/HAK archive to a writer with explicit layout options.

ยงErrors

ErfBinaryError::ValueOverflow is the arm nearly everything lands on, naming the field: the entry count, the language count, any table offset or size, and the running data offset all live in u32 on disk, so an archive large enough to push one past that cannot be written. The offsets are computed before any byte goes out, so an overflow there leaves the writer untouched.

ErfBinaryError::TextEncoding when a localized string has no Windows-1252 form, naming its index, and ErfBinaryError::Io when the writer fails. The I/O arm can leave a partial archive.