wavelength 1.0.0
Loading...
Searching...
No Matches
Tools::BuildImage::ImageBuilder Class Reference

Writer of an ISO image of a volume with replaced files. More...

#include <imagebuilder.h>

Public Member Functions

std::expected< std::uint32_t, Error > write (const std::filesystem::path &output)
 Write the ISO image and check the replaced extents.

Static Public Member Functions

static std::expected< ImageBuilder, Error > plan (Volume &source, std::vector< Replacement > replacements)
 Place each payload and collect the sectors that change.

Detailed Description

Writer of an ISO image of a volume with replaced files.

A payload fitting its original extent overwrites the extent with zero padding. A larger payload moves to sectors appended after the volume, and the volume size grows with it. Either way the ISO9660 directory record of the file gets the payload's extent, its size, and its modification time. Each directory above the file, up to the root, is raised to that time when it is older, and the primary volume descriptor's modification date becomes the root directory's date when that is newer. Every other date is copied from the input.

On a DVD image the UDF file system gets the same changes. The file entry gets the extent, the size, and the modification and attribute times, the directory file entries above it are raised, and the integrity descriptor's recording time is raised. When a payload moves, the partition grows to cover the appended sectors, and a copy of the anchor volume descriptor pointer follows them as the last sector.

Member Function Documentation

◆ plan()

std::expected< ImageBuilder, Error > Tools::BuildImage::ImageBuilder::plan ( Volume & source,
std::vector< Replacement > replacements )
static

Place each payload and collect the sectors that change.

Parameters
sourceOpen original image or disc root. It must outlive the builder.
replacementsPayloads in placement order.
Returns
The planned image, or an error when a target is missing or its directory record cannot be patched.

◆ write()

std::expected< std::uint32_t, Error > Tools::BuildImage::ImageBuilder::write ( const std::filesystem::path & output)

Write the ISO image and check the replaced extents.

Parameters
outputDestination ISO image path.
Returns
Sectors in the output image, or an error when the source ends early, the file cannot be written, a replaced extent does not open with its payload, or an ISO9660 or UDF record of a replaced file does not have the payload's extent, size, and date.

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