22 , syncDirAsDSKSetting(
23 reactor.getCommandController(),
"DirAsDSKmode",
24 "type of synchronisation between host directory and dir-as-dsk diskimage",
29 reactor.getCommandController(),
"bootsector",
30 "boot sector type for dir-as-dsk",
32 {
"DOS1", DirAsDSK::BOOTSECTOR_DOS1},
33 {
"DOS2", DirAsDSK::BOOTSECTOR_DOS2}})
37 std::unique_ptr<Disk> DiskFactory::createDisk(
40 if (diskImage ==
"ramdsk") {
41 return std::make_unique<RamDSKDiskImage>();
47 return std::make_unique<DirAsDSK>(
51 syncDirAsDSKSetting.getEnum(),
52 bootSectorSetting.getEnum());
57 auto file = std::make_shared<File>(
filename, File::PRE_CACHE);
60 return std::make_unique<XSADiskImage>(
filename, *file);
67 return std::make_unique<DMKDiskImage>(
filename, file);
72 return std::make_unique<DSKDiskImage>(
filename, std::move(file));
82 auto pos = diskImage.find_last_of(
':');
83 if (pos == string::npos) {
87 std::shared_ptr<SectorAccessibleDisk> wholeDisk;
89 Filename filename2(diskImage.substr(0, pos));
90 wholeDisk = std::make_shared<DSKDiskImage>(filename2);
98 auto n = StringOp::stringToBase<10, unsigned>(std::string_view(diskImage).
substr(pos + 1));
106 return std::make_unique<DiskPartition>(disk, num, std::move(wholeDisk));
DiskFactory(Reactor &reactor)
std::vector< std::pair< std::string, DirAsDSK::BootSectorType > > Map
This class represents a filename.
Contains the main loop of openMSX.
This file implemented 3 utility functions:
constexpr const char *const filename
FileContext userFileContext(string_view savePath)
std::string_view substr(std::string_view utf8, std::string_view::size_type first=0, std::string_view::size_type len=std::string_view::npos)