openMSX
Functions
openmsx::DiskImageUtils Namespace Reference

Functions

bool hasPartitionTable (SectorAccessibleDisk &disk)
 Check whether the given disk is partitioned. More...
 
void checkValidPartition (SectorAccessibleDisk &disk, unsigned partition)
 Checks whether the disk is partitioned the specified partition exists throws a CommandException if one of these conditions is false. More...
 
void checkFAT12Partition (SectorAccessibleDisk &disk, unsigned partition)
 Like above, but also check whether partition is of type FAT12. More...
 
void format (SectorAccessibleDisk &disk, bool dos1=false)
 Format the given disk (= a single partition). More...
 
void partition (SectorAccessibleDisk &disk, const std::vector< unsigned > &sizes)
 Write a partition table to the given disk and format each partition. More...
 

Function Documentation

◆ checkFAT12Partition()

void openmsx::DiskImageUtils::checkFAT12Partition ( SectorAccessibleDisk disk,
unsigned  partition 
)

◆ checkValidPartition()

void openmsx::DiskImageUtils::checkValidPartition ( SectorAccessibleDisk disk,
unsigned  partition 
)

Checks whether the disk is partitioned the specified partition exists throws a CommandException if one of these conditions is false.

Parameters
diskThe disk to check.
partitionPartition number, in range [1..31].

Definition at line 52 of file DiskImageUtils.cc.

Referenced by openmsx::DiskPartition::DiskPartition().

◆ format()

void openmsx::DiskImageUtils::format ( SectorAccessibleDisk disk,
bool  dos1 = false 
)

◆ hasPartitionTable()

bool openmsx::DiskImageUtils::hasPartitionTable ( SectorAccessibleDisk disk)

Check whether the given disk is partitioned.

Definition at line 22 of file DiskImageUtils.cc.

References openmsx::PartitionTable::part, partition(), openmsx::SectorBuffer::pt, and openmsx::SectorAccessibleDisk::readSector().

Referenced by openmsx::DiskManipulator::unregisterDrive().

◆ partition()

void openmsx::DiskImageUtils::partition ( SectorAccessibleDisk disk,
const std::vector< unsigned > &  sizes 
)

Write a partition table to the given disk and format each partition.

Parameters
diskThe disk to partition.
sizesThe number of sectors for each partition.

Definition at line 226 of file DiskImageUtils.cc.

References format(), and openmsx::SectorAccessibleDisk::writeSector().

Referenced by openmsx::NowindCommand::createDiskChanger(), openmsx::DiskPartition::DiskPartition(), hasPartitionTable(), and openmsx::DiskManipulator::unregisterDrive().