wavelength 1.0.0
Loading...
Searching...
No Matches
Tools::BuildImage::UdfTree Class Reference

The UDF bridge file system of a DVD image, beside its ISO9660 tree. More...

#include <udftree.h>

Classes

struct  File
 A file of the UDF tree. More...

Public Member Functions

std::expected< File, Error > find (std::uint32_t lba) const
 Locate the file whose data starts at a sector.
std::uint32_t partitionStart () const
 Report the first sector of the partition.
const std::vector< std::uint32_t > & partitionDescriptors () const
 List the sectors of the partition descriptors in both volume descriptor sequences.
std::optional< std::uint32_t > integrityDescriptor () const
 Report the sector of the logical volume integrity descriptor.

Static Public Member Functions

static std::expected< std::optional< UdfTree >, Error > open (Volume &volume)
 Read the UDF structures of a volume.
static void setFile (Volume::Sector &entry, std::uint32_t size, std::uint32_t block, Seconds modified)
 Give a file entry a new single extent and date.
static void raiseModified (Volume::Sector &entry, Seconds time)
 Raise the modification time of a file entry.
static void raiseIntegrity (Volume::Sector &descriptor, Seconds time, std::uint32_t partitionLength)
 Raise the recording time of a logical volume integrity descriptor and set its partition size.
static std::uint32_t partitionLength (const Volume::Sector &descriptor)
 Read the length of a partition descriptor.
static void setPartitionLength (Volume::Sector &descriptor, std::uint32_t length)
 Set the length of a partition descriptor.
static void relocate (Volume::Sector &descriptor, std::uint32_t location)
 Move a descriptor to another sector by rewriting its tag location.

Static Public Attributes

static constexpr std::uint32_t kAnchorSector = 256
 Sector of the first anchor volume descriptor pointer.

Detailed Description

The UDF bridge file system of a DVD image, beside its ISO9660 tree.

Reading follows the anchor volume descriptor pointer at sector 256 to the partition and the file set, then walks every directory from the root. Each file is found by the first sector of its data, which the ISO9660 directory record of the same file also gives. The static editors change one descriptor sector and recompute its descriptor CRC and tag checksum.

Member Function Documentation

◆ open()

std::expected< std::optional< UdfTree >, Error > Tools::BuildImage::UdfTree::open ( Volume & volume)
static

Read the UDF structures of a volume.

Parameters
volumeVolume to read.
Returns
The tree, nothing when sector 256 has no anchor volume descriptor pointer, or an error when a descriptor is missing or malformed.

◆ find()

std::expected< File, Error > Tools::BuildImage::UdfTree::find ( std::uint32_t lba) const
nodiscard

Locate the file whose data starts at a sector.

Parameters
lbaFirst data sector.
Returns
The file, or an error when no file starts there or the file has several extents.

◆ partitionStart()

std::uint32_t Tools::BuildImage::UdfTree::partitionStart ( ) const
nodiscard

Report the first sector of the partition.

Returns
Sector of logical block zero.

◆ partitionDescriptors()

const std::vector< std::uint32_t > & Tools::BuildImage::UdfTree::partitionDescriptors ( ) const
nodiscard

List the sectors of the partition descriptors in both volume descriptor sequences.

Returns
Sectors of the partition descriptors.

◆ integrityDescriptor()

std::optional< std::uint32_t > Tools::BuildImage::UdfTree::integrityDescriptor ( ) const
nodiscard

Report the sector of the logical volume integrity descriptor.

Returns
The sector, or nothing when the volume has no integrity descriptor.

◆ setFile()

void Tools::BuildImage::UdfTree::setFile ( Volume::Sector & entry,
std::uint32_t size,
std::uint32_t block,
Seconds modified )
static

Give a file entry a new single extent and date.

The information length, the logical blocks recorded, the extent of the allocation descriptor, the modification time, and the attribute time change.

Parameters
entrySector of a file entry or an extended file entry.
sizeLength of the data in bytes.
blockLogical block of the data within the partition.
modifiedDate of the data, in UTC.

◆ raiseModified()

void Tools::BuildImage::UdfTree::raiseModified ( Volume::Sector & entry,
Seconds time )
static

Raise the modification time of a file entry.

A later time stays unchanged.

Parameters
entrySector of a file entry or an extended file entry.
timeEarliest modification time, in UTC.

◆ raiseIntegrity()

void Tools::BuildImage::UdfTree::raiseIntegrity ( Volume::Sector & descriptor,
Seconds time,
std::uint32_t partitionLength )
static

Raise the recording time of a logical volume integrity descriptor and set its partition size.

A later recording time stays unchanged.

Parameters
descriptorSector of the integrity descriptor.
timeEarliest recording time, in UTC.
partitionLengthLength of the partition in blocks.

◆ partitionLength()

std::uint32_t Tools::BuildImage::UdfTree::partitionLength ( const Volume::Sector & descriptor)
static

Read the length of a partition descriptor.

Parameters
descriptorSector of the partition descriptor.
Returns
Length of the partition in blocks.

◆ setPartitionLength()

void Tools::BuildImage::UdfTree::setPartitionLength ( Volume::Sector & descriptor,
std::uint32_t length )
static

Set the length of a partition descriptor.

Parameters
descriptorSector of the partition descriptor.
lengthLength of the partition in blocks.

◆ relocate()

void Tools::BuildImage::UdfTree::relocate ( Volume::Sector & descriptor,
std::uint32_t location )
static

Move a descriptor to another sector by rewriting its tag location.

Parameters
descriptorSector of the descriptor.
locationNew tag location.

Member Data Documentation

◆ kAnchorSector

std::uint32_t Tools::BuildImage::UdfTree::kAnchorSector = 256
staticconstexpr

Sector of the first anchor volume descriptor pointer.


The documentation for this class was generated from the following file: