12using namespace DiskImageUtils;
14[[nodiscard]]
static DiskName getDiskName(SectorAccessibleDisk* disk,
unsigned partition)
16 if (
const auto* dsk =
dynamic_cast<Disk*
>(disk)) {
25 std::shared_ptr<SectorAccessibleDisk> owned_)
28 , owned(
std::move(owned_))
30 assert(!owned || (owned.get() == &disk));
44 size_t start_,
size_t length)
52void DiskPartition::readSectorImpl(
size_t sector,
SectorBuffer& buf)
57void DiskPartition::writeSectorImpl(
size_t sector,
const SectorBuffer& buf)
62bool DiskPartition::isWriteProtectedImpl()
const
const Filename & getFilename() const
DiskPartition(SectorAccessibleDisk &disk, unsigned partition, std::shared_ptr< SectorAccessibleDisk > owned=nullptr)
Return a partition (as a SectorBasedDisk) from another Disk.
bool isWriteProtected() const
size_t getNbSectors() const
void readSector(size_t sector, SectorBuffer &buf) const
void writeSector(size_t sector, const SectorBuffer &buf)
Abstract class for disk images that only represent the logical sector information (so not the raw tra...
void setNbSectors(size_t num)
Partition & getPartition(const SectorAccessibleDisk &disk, unsigned partition, SectorBuffer &buf)
Gets the requested partition.
unsigned partition(SectorAccessibleDisk &disk, std::span< const unsigned > sizes, MSXBootSectorType bootType)
Write a partition table to the given disk and format each partition.
This file implemented 3 utility functions: