1#ifndef DISK_IMAGE_UTILS_HH
2#define DISK_IMAGE_UTILS_HH
13class SectorAccessibleDisk;
23 std::array<uint8_t, 8>
name;
37 std::array<uint8_t, 512-30>
pad;
41 std::array<uint8_t, 9>
pad1;
43 std::array<uint8_t, 512-43>
pad2;
58static_assert(
sizeof(MSXBootSector) == 512);
79 [[nodiscard]]
auto base()
const {
return subspan<8>(
filename, 0); }
80 [[nodiscard]]
auto ext ()
const {
return subspan<3>(
filename, 8); }
101static_assert(
alignof(
Partition) == 1,
"must not have alignment requirements");
106 std::array<Partition, 31>
part;
113 std::array<char, 435>
pad;
127 std::array<uint8_t, 512>
raw;
137namespace DiskImageUtils {
bool hasPartitionTable(SectorAccessibleDisk &disk)
Check whether the given disk is partitioned.
void checkSupportedPartition(SectorAccessibleDisk &disk, unsigned partition)
Check whether partition is of type FAT12 or FAT16.
Partition & getPartition(SectorAccessibleDisk &disk, unsigned partition, SectorBuffer &buf)
Gets the requested partition.
std::string formatAttrib(uint8_t attrib)
void format(SectorAccessibleDisk &disk, MSXBootSectorType bootType)
Format the given disk (= a single partition).
time_t fromTimeDate(FatTimeDate timeDate)
unsigned partition(SectorAccessibleDisk &disk, std::span< const unsigned > sizes, MSXBootSectorType bootType)
Write a partition table to the given disk and format each partition.
FatTimeDate toTimeDate(time_t totalSeconds)
This file implemented 3 utility functions:
std::array< uint8_t, 512-30 > pad
struct openmsx::MSXBootSector::@1::@2 dos1
struct openmsx::MSXBootSector::@1::@4 extended
struct openmsx::MSXBootSector::@1::@3 dos2
uint8_t extendedBootSignature
std::array< uint8_t, 3 > jumpCode
Endian::L16 hiddenSectors
std::array< uint8_t, 8 > fileSystemType
std::array< uint8_t, 8 > name
std::array< uint8_t, 11 > volumeLabel
Endian::UA_L16 dirEntries
union openmsx::MSXBootSector::@1 params
std::array< uint8_t, 512-62 > padding
std::array< uint8_t, 512-43 > pad2
std::array< uint8_t, 9 > pad1
Endian::L32 hiddenSectors
std::array< uint8_t, 10 > reserved
bool operator==(const MSXDirEntry &other) const =default
std::array< char, 8+3 > filename
std::array< char, 435 > pad
std::array< Partition, 4 > part
std::array< char, 11 > header
std::array< Partition, 31 > part
std::array< char, 3 > pad
std::array< char, 11 > header
PartitionTableSunrise ptSunrise
std::array< uint8_t, 512 > raw
std::array< MSXDirEntry, 16 > dirEntry
PartitionTableNextor ptNextor