47 static std::expected<ImageBuilder, Error>
plan(
Volume &source,
48 std::vector<Replacement> replacements);
59 std::expected<std::uint32_t, Error>
write(
const std::filesystem::path &output);
63 using RecordEdit = std::function<bool(std::span<std::uint8_t>)>;
65 ImageBuilder(
Volume &source, std::vector<Replacement> replacements);
67 std::expected<Volume::Sector *, Error> sector(std::uint32_t lba);
68 std::expected<bool, Error> editRecords(
const DirectoryExtent &directory,
69 const RecordEdit &edit);
70 std::expected<void, Error> placePayloads();
71 std::expected<void, Error>
73 std::expected<void, Error> patchDescriptor(std::uint32_t volumeSectors);
74 [[nodiscard]] std::expected<void, Error> verify(
const std::filesystem::path &image)
const;
77 std::vector<Replacement> replacements_;
78 std::map<std::uint32_t, Volume::Sector> overlays_;
79 std::uint32_t volumeSectors_ = 0;
80 std::vector<std::pair<std::string, std::uint32_t>> written_;