17class SourceImage final :
public Volume {
26 static std::expected<std::unique_ptr<SourceImage>,
Error>
27 open(
const std::filesystem::path &path);
30 std::expected<LocatedFile, Error>
find(
const std::string &name)
override;
33 std::span<std::uint8_t, kSectorData> sector)
override;
35 std::expected<std::size_t, Error>
readSectors(std::uint32_t lba,
36 std::span<std::uint8_t> sectors)
override;
42 std::size_t dataOffset = 0;
43 std::size_t sectorSize = 0;
44 std::uint32_t trackStart = 0;
48 bool isDirectory =
false;
49 std::uint32_t lba = 0;
51 bool multiExtent =
false;
53 std::uint32_t size = 0;
56 using Layout = std::pair<std::filesystem::path, Geometry>;
58 SourceImage(std::ifstream handle, Geometry geometry);
60 static std::expected<Layout, Error> detectGeometry(
const std::filesystem::path &path);
61 static std::expected<Layout, Error> parseCue(
const std::filesystem::path &path);
62 static std::expected<std::filesystem::path, Error>
63 resolveBinPath(
const std::filesystem::path &directory,
const std::string &binName);
64 std::expected<std::vector<Record>,
Error> records(std::uint32_t lba, std::uint32_t size);
66 std::ifstream handle_;
68 std::uint32_t volumeSectors_ = 0;
69 std::vector<char> rawBuffer_;