openMSX
|
#include <Completer.hh>
Classes | |
struct | AtLeast |
struct | Between |
struct | Prefix |
Public Member Functions | |
const std::string & | getName () const |
virtual std::string | help (const std::vector< std::string > &tokens) const =0 |
Print help for this command. More... | |
virtual void | tabCompletion (std::vector< std::string > &tokens) const =0 |
Attempt tab completion for this command. More... | |
virtual Interpreter & | getInterpreter () const =0 |
void | checkNumArgs (span< const TclObject > tokens, unsigned exactly, const char *errMessage) const |
void | checkNumArgs (span< const TclObject > tokens, AtLeast atLeast, const char *errMessage) const |
void | checkNumArgs (span< const TclObject > tokens, Between between, const char *errMessage) const |
void | checkNumArgs (span< const TclObject > tokens, unsigned exactly, Prefix prefix, const char *errMessage) const |
void | checkNumArgs (span< const TclObject > tokens, AtLeast atLeast, Prefix prefix, const char *errMessage) const |
void | checkNumArgs (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, const 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 (const std::vector< std::string_view > &input) |
static void | setOutput (InterpreterOutput *output_) |
Protected Member Functions | |
Completer (std::string_view name) | |
~Completer ()=default | |
Definition at line 17 of file Completer.hh.
|
explicitprotected |
Definition at line 22 of file Completer.cc.
|
protecteddefault |
void openmsx::Completer::checkNumArgs | ( | 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 | ( | 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, span< ElementType, Extent >::size(), and openmsx::Interpreter::wrongNumArgs().
void openmsx::Completer::checkNumArgs | ( | 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 | ( | 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, span< ElementType, Extent >::size(), and openmsx::Interpreter::wrongNumArgs().
void openmsx::Completer::checkNumArgs | ( | span< const TclObject > | tokens, |
unsigned | exactly, | ||
const char * | errMessage | ||
) | const |
Definition at line 181 of file Completer.cc.
Referenced by checkNumArgs(), openmsx::MachineExtensionInfo::execute(), openmsx::DeviceInfo::execute(), openmsx::MessageCommand::execute(), openmsx::Sha1SumCommand::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 | ( | 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, span< ElementType, Extent >::size(), and openmsx::Interpreter::wrongNumArgs().
|
static |
Definition at line 131 of file Completer.cc.
References gl::context.
|
static |
Definition at line 139 of file Completer.hh.
References gl::context.
Referenced by openmsx::NowindCommand::tabCompletion(), openmsx::HDCommand::tabCompletion(), openmsx::FilenameSetting::tabCompletion(), openmsx::DiskCommand::tabCompletion(), openmsx::Sha1SumCommand::tabCompletion(), openmsx::CDXCommand::tabCompletion(), openmsx::LSXCommand::tabCompletion(), and openmsx::RestoreMachineCommand::tabCompletion().
|
static |
Definition at line 111 of file Completer.hh.
|
static |
Definition at line 125 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::DeviceInfo::tabCompletion(), openmsx::MachineCommand::tabCompletion(), openmsx::TestMachineCommand::tabCompletion(), openmsx::DeleteMachineCommand::tabCompletion(), openmsx::ActivateMachineCommand::tabCompletion(), openmsx::StoreMachineCommand::tabCompletion(), openmsx::ConfigInfo::tabCompletion(), and openmsx::EnumSettingBase::tabCompletionBase().
NEVER_INLINE std::vector<std::string_view> openmsx::Completer::filter | ( | std::string_view | str, |
ITER | begin, | ||
ITER | end, | ||
bool | caseSensitive | ||
) |
Definition at line 91 of file Completer.hh.
|
static |
Definition at line 60 of file Completer.cc.
References openmsx::InterpreterOutput::getOutputColumns().
|
pure virtual |
Implemented in openmsx::InfoTopic, and openmsx::CommandCompleter.
Referenced by checkNumArgs().
|
inline |
Definition at line 20 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::RealTimeInfo, openmsx::ConfigInfo, openmsx::SetClipboardCommand, openmsx::GetClipboardCommand, openmsx::RestoreMachineCommand, openmsx::StoreMachineCommand, openmsx::ActivateMachineCommand, openmsx::ListMachinesCommand, openmsx::DeleteMachineCommand, openmsx::CreateMachineCommand, openmsx::TestMachineCommand, openmsx::MachineCommand, openmsx::ExitCommand, openmsx::DeviceInfo, openmsx::MachineExtensionInfo, openmsx::MachineTypeInfo, openmsx::MachineNameInfo, openmsx::RemoveExtCmd, openmsx::ListExtCmd, openmsx::LoadMachineCmd, openmsx::ResetCmd, openmsx::LSXCommand, openmsx::CDXCommand, openmsx::Sha1SumCommand, openmsx::DiskCommand, openmsx::InfoTopic, openmsx::SoftwareInfoTopic, openmsx::ExtCmd, openmsx::RomInfoTopic, openmsx::HDCommand, openmsx::NowindCommand, openmsx::MessageCommand, openmsx::AfterCommand, and openmsx::ProxyCmd.
|
inlinestatic |
Definition at line 65 of file Completer.hh.
Referenced by openmsx::CommandConsole::CommandConsole(), and openmsx::CommandConsole::~CommandConsole().
|
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::ConfigInfo, openmsx::RestoreMachineCommand, openmsx::StoreMachineCommand, openmsx::ActivateMachineCommand, openmsx::DeleteMachineCommand, openmsx::TestMachineCommand, openmsx::MachineCommand, openmsx::DeviceInfo, openmsx::MachineExtensionInfo, openmsx::RemoveExtCmd, openmsx::LoadMachineCmd, openmsx::LSXCommand, openmsx::CDXCommand, openmsx::Sha1SumCommand, openmsx::DiskCommand, openmsx::ExtCmd, openmsx::RomInfoTopic, openmsx::HDCommand, openmsx::NowindCommand, openmsx::MessageCommand, openmsx::AfterCommand, openmsx::ProxyCmd, openmsx::InfoTopic, and openmsx::Command.