14 : cmdLineParser(cmdLineParser_)
30 if (option.size() == 6) {
35 parse(arg, slotName, cmdLine);
40 return "Insert the ROM file (cartridge) specified in argument";
45 parse(arg,
"any", cmdLine);
50 return "ROM image of a cartridge";
58void MSXRomCLI::parse(
const string& arg,
const string& slotName,
59 std::span<string>& cmdLine)
62 std::vector<TclObject> options;
65 if (option ==
one_of(
"-ips",
"-romtype")) {
66 options.emplace_back(option);
67 cmdLine = cmdLine.subspan(1);
75 motherboard->insertExtension(
"ROM",
79void MSXRomCLI::IpsOption::parseOption(
const string& ,
83 "-ips options should immediately follow a ROM or disk image.");
86std::string_view MSXRomCLI::IpsOption::optionHelp()
const
88 return "Apply the given IPS patch to the ROM or disk image specified "
89 "in the preceding option";
92void MSXRomCLI::RomTypeOption::parseOption(
const string& ,
95 throw FatalError(
"-romtype options should immediately follow a ROM.");
98std::string_view MSXRomCLI::RomTypeOption::optionHelp()
const
100 return "Specify the rom type for the ROM image specified in the "
static std::string getArgument(const std::string &option, std::span< std::string > &cmdLine)
static std::string peekArgument(const std::span< std::string > &cmdLine)
void registerOption(const char *str, CLIOption &cliOption, ParsePhase phase=PHASE_LAST, unsigned length=2)
void registerFileType(std::initializer_list< std::string_view > extensions, CLIFileType &cliFileType)
MSXMotherBoard * getMotherBoard() const
static std::unique_ptr< HardwareConfig > createRomConfig(MSXMotherBoard &motherBoard, std::string_view romFile, std::string_view slotName, std::span< const TclObject > options)
void parseFileType(const std::string &arg, std::span< std::string > &cmdLine) override
std::string_view fileTypeCategoryName() const override
std::string_view fileTypeHelp() const override
std::string_view optionHelp() const override
MSXRomCLI(CommandLineParser &cmdLineParser)
void parseOption(const std::string &option, std::span< std::string > &cmdLine) override
This file implemented 3 utility functions: