openMSX
|
#include <Completer.hh>
Classes | |
struct | AtLeast |
struct | Between |
struct | Prefix |
Public Member Functions | |
Completer (const Completer &)=delete | |
Completer (Completer &&)=delete | |
Completer & | operator= (const Completer &)=delete |
Completer & | operator= (Completer &&)=delete |
const std::string & | getName () const |
virtual std::string | help (std::span< const TclObject > tokens) const =0 |
Print help for this command. | |
virtual void | tabCompletion (std::vector< std::string > &tokens) const =0 |
Attempt tab completion for this command. | |
virtual Interpreter & | getInterpreter () const =0 |
void | checkNumArgs (std::span< const TclObject > tokens, unsigned exactly, const char *errMessage) const |
void | checkNumArgs (std::span< const TclObject > tokens, AtLeast atLeast, const char *errMessage) const |
void | checkNumArgs (std::span< const TclObject > tokens, Between between, const char *errMessage) const |
void | checkNumArgs (std::span< const TclObject > tokens, unsigned exactly, Prefix prefix, const char *errMessage) const |
void | checkNumArgs (std::span< const TclObject > tokens, AtLeast atLeast, Prefix prefix, const char *errMessage) const |
void | checkNumArgs (std::span< const TclObject > tokens, Between between, Prefix prefix, const char *errMessage) const |
template<typename ITER > | |
NEVER_INLINE std::vector< std::string_view > | filter (std::string_view str, ITER begin, ITER end, bool caseSensitive) |
Static Public Member Functions | |
template<typename ITER > | |
static void | completeString (std::vector< std::string > &tokens, ITER begin, ITER end, bool caseSensitive=true) |
template<typename RANGE > | |
static void | completeString (std::vector< std::string > &tokens, RANGE &&possibleValues, bool caseSensitive=true) |
template<typename RANGE > | |
static void | completeFileName (std::vector< std::string > &tokens, const FileContext &context, const RANGE &extra) |
static void | completeFileName (std::vector< std::string > &tokens, const FileContext &context) |
static std::vector< std::string > | formatListInColumns (std::span< const std::string_view > input) |
static void | setOutput (InterpreterOutput *output_) |
Protected Member Functions | |
template<typename String > requires (!std::same_as<Completer, std::remove_cvref_t<String>>) | |
Completer (String &&name_) | |
~Completer ()=default | |
Definition at line 19 of file Completer.hh.
|
delete |
|
delete |
|
inlineexplicitprotected |
Definition at line 77 of file Completer.hh.
|
protecteddefault |
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
AtLeast | atLeast, | ||
const char * | errMessage | ||
) | const |
Definition at line 186 of file Completer.cc.
References checkNumArgs(), and openmsx::Completer::AtLeast::min.
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
AtLeast | atLeast, | ||
Prefix | prefix, | ||
const char * | errMessage | ||
) | const |
Definition at line 202 of file Completer.cc.
References getInterpreter(), openmsx::Completer::AtLeast::min, openmsx::Completer::Prefix::n, and openmsx::Interpreter::wrongNumArgs().
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
Between | between, | ||
const char * | errMessage | ||
) | const |
Definition at line 191 of file Completer.cc.
References checkNumArgs(), and openmsx::Completer::Between::min.
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
Between | between, | ||
Prefix | prefix, | ||
const char * | errMessage | ||
) | const |
Definition at line 208 of file Completer.cc.
References getInterpreter(), openmsx::Completer::Between::max, openmsx::Completer::Between::min, openmsx::Completer::Prefix::n, and openmsx::Interpreter::wrongNumArgs().
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
unsigned | exactly, | ||
const char * | errMessage | ||
) | const |
Definition at line 181 of file Completer.cc.
References checkNumArgs().
Referenced by checkNumArgs(), checkNumArgs(), checkNumArgs(), openmsx::MachineExtensionInfo::execute(), openmsx::MachineMediaInfo::execute(), openmsx::DeviceInfo::execute(), openmsx::MessageCommand::execute(), openmsx::LoadMachineCmd::execute(), openmsx::ExitCommand::execute(), openmsx::MachineCommand::execute(), openmsx::TestMachineCommand::execute(), openmsx::CreateMachineCommand::execute(), openmsx::DeleteMachineCommand::execute(), openmsx::ActivateMachineCommand::execute(), openmsx::StoreMachineCommand::execute(), openmsx::RestoreMachineCommand::execute(), openmsx::GetClipboardCommand::execute(), openmsx::SetClipboardCommand::execute(), openmsx::RemoveExtCmd::execute(), and openmsx::ExtCmd::execute().
void openmsx::Completer::checkNumArgs | ( | std::span< const TclObject > | tokens, |
unsigned | exactly, | ||
Prefix | prefix, | ||
const char * | errMessage | ||
) | const |
Definition at line 196 of file Completer.cc.
References getInterpreter(), openmsx::Completer::Prefix::n, and openmsx::Interpreter::wrongNumArgs().
|
static |
Definition at line 130 of file Completer.cc.
|
static |
Definition at line 152 of file Completer.hh.
Referenced by openmsx::DiskCommand::tabCompletion(), openmsx::NowindCommand::tabCompletion(), openmsx::HDCommand::tabCompletion(), openmsx::CDXCommand::tabCompletion(), openmsx::LSXCommand::tabCompletion(), openmsx::FilenameSetting::tabCompletion(), and openmsx::RestoreMachineCommand::tabCompletion().
|
static |
Definition at line 138 of file Completer.hh.
References begin(), and end().
Referenced by openmsx::AfterCommand::tabCompletion(), openmsx::MessageCommand::tabCompletion(), openmsx::RomInfoTopic::tabCompletion(), openmsx::ExtCmd::tabCompletion(), openmsx::BooleanSetting::tabCompletion(), openmsx::VideoSourceSetting::tabCompletion(), openmsx::LoadMachineCmd::tabCompletion(), openmsx::RemoveExtCmd::tabCompletion(), openmsx::MachineExtensionInfo::tabCompletion(), openmsx::MachineMediaInfo::tabCompletion(), openmsx::DeviceInfo::tabCompletion(), openmsx::MachineCommand::tabCompletion(), openmsx::TestMachineCommand::tabCompletion(), openmsx::DeleteMachineCommand::tabCompletion(), openmsx::ActivateMachineCommand::tabCompletion(), openmsx::StoreMachineCommand::tabCompletion(), openmsx::ConfigInfo::tabCompletion(), and openmsx::EnumSettingBase::tabCompletionBase().
|
static |
Definition at line 124 of file Completer.hh.
NEVER_INLINE std::vector< std::string_view > openmsx::Completer::filter | ( | std::string_view | str, |
ITER | begin, | ||
ITER | end, | ||
bool | caseSensitive | ||
) |
Definition at line 104 of file Completer.hh.
|
static |
Definition at line 59 of file Completer.cc.
References openmsx::InterpreterOutput::getOutputColumns().
|
pure virtual |
Implemented in openmsx::CommandCompleter, and openmsx::InfoTopic.
Referenced by checkNumArgs(), checkNumArgs(), and checkNumArgs().
|
inline |
Definition at line 27 of file Completer.hh.
Referenced by openmsx::Command::Command(), openmsx::CommandCompleter::CommandCompleter(), openmsx::ProxyCmd::execute(), openmsx::ProxyCmd::help(), openmsx::MSXCommandController::registerCommand(), openmsx::InfoCommand::registerTopic(), openmsx::MSXCommandController::unregisterCommand(), openmsx::InfoCommand::unregisterTopic(), openmsx::Command::~Command(), and openmsx::CommandCompleter::~CommandCompleter().
|
pure virtual |
Print help for this command.
Implemented in openmsx::ProxyCmd, openmsx::AfterCommand, openmsx::MessageCommand, openmsx::DiskCommand, openmsx::NowindCommand, openmsx::HDCommand, openmsx::CDXCommand, openmsx::LSXCommand, openmsx::RomInfoTopic, openmsx::ResetCmd, openmsx::LoadMachineCmd, openmsx::ListExtCmd, openmsx::RemoveExtCmd, openmsx::MachineNameInfo, openmsx::MachineTypeInfo, openmsx::MachineExtensionInfo, openmsx::MachineMediaInfo, openmsx::DeviceInfo, openmsx::ExtCmd, openmsx::ExitCommand, openmsx::MachineCommand, openmsx::TestMachineCommand, openmsx::CreateMachineCommand, openmsx::DeleteMachineCommand, openmsx::ListMachinesCommand, openmsx::ActivateMachineCommand, openmsx::StoreMachineCommand, openmsx::RestoreMachineCommand, openmsx::GetClipboardCommand, openmsx::SetClipboardCommand, openmsx::ConfigInfo, openmsx::RealTimeInfo, openmsx::SoftwareInfoTopic, and openmsx::InfoTopic.
|
inlinestatic |
Definition at line 72 of file Completer.hh.
Referenced by openmsx::ImGuiConsole::ImGuiConsole().
|
pure virtual |
Attempt tab completion for this command.
tokens | Tokenized command line; tokens[0] is the command itself. The last token is incomplete, this method tries to complete it. |
Implemented in openmsx::Command, openmsx::InfoTopic, openmsx::ProxyCmd, openmsx::AfterCommand, openmsx::MessageCommand, openmsx::DiskCommand, openmsx::NowindCommand, openmsx::HDCommand, openmsx::CDXCommand, openmsx::LSXCommand, openmsx::RomInfoTopic, openmsx::ExtCmd, openmsx::LoadMachineCmd, openmsx::RemoveExtCmd, openmsx::MachineExtensionInfo, openmsx::MachineMediaInfo, openmsx::DeviceInfo, openmsx::MachineCommand, openmsx::TestMachineCommand, openmsx::DeleteMachineCommand, openmsx::ActivateMachineCommand, openmsx::StoreMachineCommand, openmsx::RestoreMachineCommand, and openmsx::ConfigInfo.