9 using namespace DiskImageUtils;
11 [[nodiscard]]
static DiskName getDiskName(SectorAccessibleDisk* disk,
unsigned partition)
13 if (
auto* dsk =
dynamic_cast<Disk*
>(disk)) {
14 return DiskName(dsk->getName().getFilename(),
22 std::shared_ptr<SectorAccessibleDisk> owned_)
25 , owned(std::move(owned_))
27 assert(!owned || (owned.get() == &disk));
43 size_t start_,
size_t length)
51 void DiskPartition::readSectorImpl(
size_t sector,
SectorBuffer& buf)
56 void DiskPartition::writeSectorImpl(
size_t sector,
const SectorBuffer& buf)
61 bool DiskPartition::isWriteProtectedImpl()
const
DiskPartition(SectorAccessibleDisk &disk, unsigned partition, std::shared_ptr< SectorAccessibleDisk > owned=nullptr)
Return a partition (as a SectorbasedDisk) from another Disk.
bool isWriteProtected() const
void readSector(size_t sector, SectorBuffer &buf)
size_t getNbSectors() 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)
T length(const vecN< N, T > &x)
void checkValidPartition(SectorAccessibleDisk &disk, unsigned partition)
Checks whether the disk is partitioned the specified partition exists throws a CommandException if on...
void partition(SectorAccessibleDisk &disk, const std::vector< unsigned > &sizes)
Write a partition table to the given disk and format each partition.
This file implemented 3 utility functions:
std::string strCat(Ts &&...ts)