The data sectors of an ISO9660 volume, from a disc image or built from a disc root.
More...
#include <volume.h>
|
| virtual | ~Volume ()=default |
| | Release the medium.
|
| virtual std::expected< LocatedFile, Error > | find (const std::string &name)=0 |
| | Locate a file by name anywhere in the tree.
|
| virtual std::expected< void, Error > | readSector (std::uint32_t lba, std::span< std::uint8_t, kSectorData > sector)=0 |
| | Read the data bytes of one sector.
|
| virtual std::expected< std::size_t, Error > | readSectors (std::uint32_t lba, std::span< std::uint8_t > sectors) |
| | Read the data bytes of consecutive sectors, stopping where the medium ends.
|
| virtual std::uint32_t | volumeSectors () const =0 |
| | Report the sector count of the volume.
|
| std::expected< std::string, Error > | bootExecutable () |
| | Read the name of the executable the disc boots.
|
|
| static std::expected< std::string, Error > | parseBoot2 (std::span< const std::uint8_t > data) |
| | Read the executable name from the text of SYSTEM.CNF.
|
| static std::uint32_t | sectorsFor (std::uint64_t size) |
| | Count the sectors that a length in bytes occupies.
|
| static std::string | upperAscii (std::string_view text) |
| | Convert the ASCII letters of a text to upper case.
|
| static std::string | lowerAscii (std::string_view text) |
| | Convert the ASCII letters of a text to lower case.
|
| static std::unexpected< Error > | pastEnd (std::uint32_t lba) |
| | Report that a sector lies past the end of the medium.
|
|
| static constexpr std::size_t | kSectorData = 2048 |
| | Data bytes in one sector.
|
| static constexpr std::uint32_t | kPvdSector = 16 |
| | Sector of the primary volume descriptor.
|
| static constexpr std::string_view | kPvdMagic = "CD001" |
| | Identifier of an ISO9660 volume descriptor.
|
| static constexpr std::string_view | kSystemCnf = "SYSTEM.CNF" |
| | Name of the boot configuration file.
|
| static constexpr std::string_view | kPalExecutable = "SCES_507.91" |
| | Executable of the European release.
|
| static constexpr std::string_view | kNtscExecutable = "SCUS_971.25" |
| | Executable of the North American release.
|
The data sectors of an ISO9660 volume, from a disc image or built from a disc root.
◆ Sector
The data bytes of one sector.
◆ ~Volume()
| virtual Tools::BuildImage::Volume::~Volume |
( |
| ) |
|
|
virtualdefault |
◆ find()
| virtual std::expected< LocatedFile, Error > Tools::BuildImage::Volume::find |
( |
const std::string & | name | ) |
|
|
pure virtual |
◆ readSector()
| virtual std::expected< void, Error > Tools::BuildImage::Volume::readSector |
( |
std::uint32_t | lba, |
|
|
std::span< std::uint8_t, kSectorData > | sector ) |
|
pure virtual |
◆ readSectors()
| virtual std::expected< std::size_t, Error > Tools::BuildImage::Volume::readSectors |
( |
std::uint32_t | lba, |
|
|
std::span< std::uint8_t > | sectors ) |
|
virtual |
Read the data bytes of consecutive sectors, stopping where the medium ends.
- Parameters
-
| lba | First sector number relative to the track start. |
| sectors | Destination, a whole number of sectors long. |
- Returns
- Number of sectors read in full, or an error when a source file cannot be read.
Reimplemented in Tools::BuildImage::SourceImage.
◆ volumeSectors()
| virtual std::uint32_t Tools::BuildImage::Volume::volumeSectors |
( |
| ) |
const |
|
nodiscardpure virtual |
◆ bootExecutable()
| std::expected< std::string, Error > Tools::BuildImage::Volume::bootExecutable |
( |
| ) |
|
Read the name of the executable the disc boots.
- Returns
- File name from the BOOT2 line of SYSTEM.CNF, without the version suffix, or an error when SYSTEM.CNF does not boot a known release.
◆ parseBoot2()
| std::expected< std::string, Error > Tools::BuildImage::Volume::parseBoot2 |
( |
std::span< const std::uint8_t > | data | ) |
|
|
static |
Read the executable name from the text of SYSTEM.CNF.
- Parameters
-
| data | Contents of SYSTEM.CNF. |
- Returns
- File name from the BOOT2 line, without the version suffix, or an error when the text does not have a BOOT2 line or the line identifies an unknown executable.
◆ sectorsFor()
| std::uint32_t Tools::BuildImage::Volume::sectorsFor |
( |
std::uint64_t | size | ) |
|
|
static |
Count the sectors that a length in bytes occupies.
- Parameters
-
- Returns
- Sectors, rounded up.
◆ upperAscii()
| std::string Tools::BuildImage::Volume::upperAscii |
( |
std::string_view | text | ) |
|
|
static |
Convert the ASCII letters of a text to upper case.
- Parameters
-
- Returns
- The text with each ASCII letter in upper case.
◆ lowerAscii()
| std::string Tools::BuildImage::Volume::lowerAscii |
( |
std::string_view | text | ) |
|
|
static |
Convert the ASCII letters of a text to lower case.
- Parameters
-
- Returns
- The text with each ASCII letter in lower case.
◆ pastEnd()
| std::unexpected< Error > Tools::BuildImage::Volume::pastEnd |
( |
std::uint32_t | lba | ) |
|
|
static |
Report that a sector lies past the end of the medium.
- Parameters
-
| lba | Sector number relative to the track start. |
- Returns
- The error.
◆ kSectorData
| std::size_t Tools::BuildImage::Volume::kSectorData = 2048 |
|
staticconstexpr |
Data bytes in one sector.
◆ kPvdSector
| std::uint32_t Tools::BuildImage::Volume::kPvdSector = 16 |
|
staticconstexpr |
Sector of the primary volume descriptor.
◆ kPvdMagic
| std::string_view Tools::BuildImage::Volume::kPvdMagic = "CD001" |
|
staticconstexpr |
Identifier of an ISO9660 volume descriptor.
◆ kSystemCnf
| std::string_view Tools::BuildImage::Volume::kSystemCnf = "SYSTEM.CNF" |
|
staticconstexpr |
Name of the boot configuration file.
◆ kPalExecutable
| std::string_view Tools::BuildImage::Volume::kPalExecutable = "SCES_507.91" |
|
staticconstexpr |
Executable of the European release.
◆ kNtscExecutable
| std::string_view Tools::BuildImage::Volume::kNtscExecutable = "SCUS_971.25" |
|
staticconstexpr |
Executable of the North American release.
The documentation for this class was generated from the following file: