resonance 1.0.1
Loading...
Searching...
No Matches
Tools::BuildImage Namespace Reference

Writer of a FreQuency disc image with the built executable and module in place. More...

Classes

class  DirectoryVolume
 An ISO9660 volume built from the files of a disc root directory. More...
class  GitHubClient
 Client of the GitHub Actions API for the build artifacts of one repository. More...
struct  Replacement
 A file of the original disc and the payload that replaces it. More...
class  ImageBuilder
 Writer of a raw MODE2/2352 image of a volume with replaced files. More...
class  SectorEncoder
 Encoder of CD-ROM XA Mode 2 Form 1 sectors with table-driven EDC and ECC. More...
class  SourceImage
 Random access to the data track of a cue, raw, or ISO disc image. More...
struct  DirectoryExtent
 The extent of a directory in the ISO9660 tree. More...
struct  LocatedFile
 A file found in the ISO9660 tree. More...
class  Volume
 The data sectors of an ISO9660 volume, from a disc image or built from a disc root. More...
class  ZipArchive
 Reader of the stored and deflated members of a zip archive in memory. More...

Typedefs

using Seconds = std::chrono::sys_seconds
 A UTC time with a resolution of one second.

Functions

std::uint16_t readLittle16 (std::span< const std::uint8_t > bytes, std::size_t offset)
 Read a little-endian 16-bit value.
std::uint32_t readLittle32 (std::span< const std::uint8_t > bytes, std::size_t offset)
 Read a little-endian 32-bit value.
void writeLittle (std::span< std::uint8_t > bytes, std::size_t offset, std::uint32_t value, std::size_t width=4)
 Write a little-endian value.
void writeBig (std::span< std::uint8_t > bytes, std::size_t offset, std::uint32_t value, std::size_t width=4)
 Write a big-endian value.
void writeBoth (std::span< std::uint8_t > bytes, std::size_t offset, std::uint32_t value, std::size_t width=4)
 Write a value in the ISO9660 both-endian form, little-endian followed by big-endian.
std::unexpected< Error > discImageError (std::string message)
 Report that the disc image cannot be read or rewritten.
std::unexpected< Error > artifactError (std::string message)
 Report that build artifacts cannot be fetched from GitHub.
std::unexpected< Error > ioError (std::string message)
 Report that a file cannot be read or written.
void writeRecordDate (std::span< std::uint8_t > bytes, std::size_t offset, Seconds time)
 Write the seven-byte date of a directory record, in UTC.
Seconds readRecordDate (std::span< const std::uint8_t > bytes, std::size_t offset)
 Read the seven-byte date of a directory record.
std::string volumeDate (Seconds time)
 Format the 16 digits of a volume descriptor date, in UTC with hundredths of zero.
std::optional< Seconds > readVolumeDate (std::span< const std::uint8_t > bytes, std::size_t offset)
 Read the 17-byte date of a volume descriptor.
std::expected< Seconds, Error > fileModificationTime (const std::filesystem::path &path)
 Read the modification time of a file or directory.

Variables

constexpr int kIsoZoneMinutes = 15
 Minutes in one step of an ISO9660 zone offset.

Detailed Description

Writer of a FreQuency disc image with the built executable and module in place.

Typedef Documentation

◆ Seconds

using Tools::BuildImage::Seconds = std::chrono::sys_seconds

A UTC time with a resolution of one second.

Function Documentation

◆ readLittle16()

std::uint16_t Tools::BuildImage::readLittle16 ( std::span< const std::uint8_t > bytes,
std::size_t offset )
inline

Read a little-endian 16-bit value.

Parameters
bytesBuffer to read.
offsetOffset of the value's first byte.
Returns
The value.

◆ readLittle32()

std::uint32_t Tools::BuildImage::readLittle32 ( std::span< const std::uint8_t > bytes,
std::size_t offset )
inline

Read a little-endian 32-bit value.

Parameters
bytesBuffer to read.
offsetOffset of the value's first byte.
Returns
The value.

◆ writeLittle()

void Tools::BuildImage::writeLittle ( std::span< std::uint8_t > bytes,
std::size_t offset,
std::uint32_t value,
std::size_t width = 4 )
inline

Write a little-endian value.

Parameters
bytesBuffer to write.
offsetOffset of the value's first byte.
valueValue to write.
widthWidth of the value in bytes.

◆ writeBig()

void Tools::BuildImage::writeBig ( std::span< std::uint8_t > bytes,
std::size_t offset,
std::uint32_t value,
std::size_t width = 4 )
inline

Write a big-endian value.

Parameters
bytesBuffer to write.
offsetOffset of the value's first byte.
valueValue to write.
widthWidth of the value in bytes.

◆ writeBoth()

void Tools::BuildImage::writeBoth ( std::span< std::uint8_t > bytes,
std::size_t offset,
std::uint32_t value,
std::size_t width = 4 )
inline

Write a value in the ISO9660 both-endian form, little-endian followed by big-endian.

Parameters
bytesBuffer to write.
offsetOffset of the little-endian copy.
valueValue to write.
widthWidth of one copy in bytes.

◆ discImageError()

std::unexpected< Error > Tools::BuildImage::discImageError ( std::string message)
inline

Report that the disc image cannot be read or rewritten.

Parameters
messageSentence describing the failure.
Returns
An ErrorCode::InvalidInput error.

◆ artifactError()

std::unexpected< Error > Tools::BuildImage::artifactError ( std::string message)
inline

Report that build artifacts cannot be fetched from GitHub.

Parameters
messageSentence describing the failure.
Returns
An ErrorCode::Network error.

◆ ioError()

std::unexpected< Error > Tools::BuildImage::ioError ( std::string message)
inline

Report that a file cannot be read or written.

Parameters
messageSentence describing the failure.
Returns
An ErrorCode::Io error.

◆ writeRecordDate()

void Tools::BuildImage::writeRecordDate ( std::span< std::uint8_t > bytes,
std::size_t offset,
Seconds time )
inline

Write the seven-byte date of a directory record, in UTC.

Parameters
bytesBuffer holding the record.
offsetOffset of the date's first byte.
timeTime to write.

◆ readRecordDate()

Seconds Tools::BuildImage::readRecordDate ( std::span< const std::uint8_t > bytes,
std::size_t offset )
inline

Read the seven-byte date of a directory record.

Parameters
bytesBuffer holding the record.
offsetOffset of the date's first byte.
Returns
The date in UTC, with the record's zone offset removed.

◆ volumeDate()

std::string Tools::BuildImage::volumeDate ( Seconds time)
inline

Format the 16 digits of a volume descriptor date, in UTC with hundredths of zero.

Parameters
timeTime to format.
Returns
The digits; the descriptor's 17th byte, the zone offset, is written separately.

◆ readVolumeDate()

std::optional< Seconds > Tools::BuildImage::readVolumeDate ( std::span< const std::uint8_t > bytes,
std::size_t offset )
inline

Read the 17-byte date of a volume descriptor.

Parameters
bytesBuffer holding the descriptor.
offsetOffset of the date's first digit.
Returns
The date in UTC, or nothing when the date is unset (all digits zero) or not digits.

◆ fileModificationTime()

std::expected< Seconds, Error > Tools::BuildImage::fileModificationTime ( const std::filesystem::path & path)
inline

Read the modification time of a file or directory.

Parameters
pathFile or directory to examine.
Returns
The time in UTC, or an error when the path cannot be examined.

Variable Documentation

◆ kIsoZoneMinutes

int Tools::BuildImage::kIsoZoneMinutes = 15
constexpr

Minutes in one step of an ISO9660 zone offset.