60 static std::expected<ImageBuilder, Error>
plan(
Volume &source,
61 std::vector<Replacement> replacements);
71 std::expected<std::uint32_t, Error>
write(
const std::filesystem::path &output);
75 using RecordEdit = std::function<bool(std::span<std::uint8_t>)>;
77 ImageBuilder(
Volume &source, std::vector<Replacement> replacements);
79 std::expected<Volume::Sector *, Error> sector(std::uint32_t lba);
80 std::expected<bool, Error> editRecords(
const DirectoryExtent &directory,
81 const RecordEdit &edit);
82 std::expected<void, Error> placePayloads();
83 std::expected<void, Error>
85 std::expected<void, Error> patchUdf(
const UdfTree &udf,
88 std::uint32_t newLba);
89 std::expected<std::uint32_t, Error>
90 patchUdfVolume(
const UdfTree &udf, std::uint32_t appendLba,
bool relocated,
Seconds newest);
91 std::expected<void, Error> patchDescriptor(std::uint32_t volumeSectors);
92 [[nodiscard]] std::expected<void, Error> verify(
const std::filesystem::path &image)
const;
95 std::vector<Replacement> replacements_;
96 std::map<std::uint32_t, Volume::Sector> overlays_;
97 std::uint32_t volumeSectors_ = 0;
98 std::vector<std::pair<std::string, std::uint32_t>> written_;