19 scheduler_, hd_.getName())
21 , powerSetting(powerSetting_)
28 if (tokens.size() == 1) {
36 }
else if ((tokens.size() == 2) ||
37 ((tokens.size() == 3) && tokens[1] ==
"insert")) {
40 "Can only change hard disk image when MSX "
44 if (tokens[1] ==
"insert") {
45 if (tokens.size() > 2) {
49 "Missing argument to insert subcommand");
53 Filename filename(tokens[fileToken].getString(),
70 return hd.
getName() +
": change the hard disk image for this hard disk drive\n";
75 using namespace std::literals;
76 static constexpr std::array extra = {
"insert"sv};
78 (tokens.size() < 3) ? extra : std::span<const std::string_view>{});
84 return tokens.size() > 1;
bool getBoolean() const noexcept
static void completeFileName(std::vector< std::string > &tokens, const FileContext &context, const RANGE &extra)
This class represents a filename.
const std::string & getResolved() const &
void tabCompletion(std::vector< std::string > &tokens) const override
Attempt tab completion for this command.
bool needRecord(std::span< const TclObject > tokens) const override
It's possible that in some cases the command doesn't need to be recorded after all (e....
HDCommand(CommandController &commandController, StateChangeDistributor &stateChangeDistributor, Scheduler &scheduler, HD &hd, const BooleanSetting &powerSetting)
void execute(std::span< const TclObject > tokens, TclObject &result, EmuTime::param time) override
This is like the execute() method of the Command class, it only has an extra time parameter.
std::string help(std::span< const TclObject > tokens) const override
Print help for this command.
const Filename & getImageName() const
void switchImage(const Filename &filename)
const std::string & getName() const
Commands that directly influence the MSX state should send and events so that they can be recorded by...
bool isWriteProtected() const
void addListElement(const T &t)
This file implemented 3 utility functions:
const FileContext & userFileContext()
TclObject makeTclList(Args &&... args)
TemporaryString tmpStrCat(Ts &&... ts)