1 #ifndef GLOBALCOMMANDCONTROLLER_HH
2 #define GLOBALCOMMANDCONTROLLER_HH
21 class EventDistributor;
55 void source(
const std::string& script);
65 std::string_view str)
override;
67 std::string_view str)
override;
71 std::string_view str)
override;
82 [[nodiscard]] std::string
tabCompletion(std::string_view command);
98 std::vector<std::pair<std::unique_ptr<ProxySetting>,
unsigned>>;
99 ProxySettings::iterator findProxySetting(std::string_view name);
111 struct HelpCmd final :
Command {
115 void tabCompletion(std::vector<std::string>& tokens)
const override;
118 struct TabCompletionCmd final : Command {
124 struct UpdateCmd final : Command {
128 void tabCompletion(std::vector<std::string>& tokens)
const override;
133 struct PlatformInfo final : InfoTopic {
134 explicit PlatformInfo(InfoCommand& openMSXInfoCommand);
136 TclObject& result)
const override;
140 struct VersionInfo final : InfoTopic {
141 explicit VersionInfo(InfoCommand& openMSXInfoCommand);
143 TclObject& result)
const override;
147 RomInfoTopic romInfoTopic;
149 struct NameFromProxy {
150 template<
typename Pair>
151 [[nodiscard]]
const std::string& operator()(
const Pair& p)
const {
152 return p.second->getName();
156 ProxySettings proxySettings;
CommandController()=default
~GlobalCommandControllerBase()
hash_map< std::string, CommandCompleter *, XXHasher > commandCompleters
CliConnection * getConnection() const
Interpreter & getInterpreter() override
GlobalCommandController & operator=(const GlobalCommandController &)=delete
GlobalCommandController(const GlobalCommandController &)=delete
void registerSetting(Setting &setting) override
TODO.
std::string tabCompletion(std::string_view command)
Complete the given command.
void registerProxyCommand(std::string_view name)
CliComm & getCliComm() override
void unregisterProxyCommand(std::string_view name)
void registerCommand(Command &command, zstring_view str) override
(Un)register a command
void registerCompleter(CommandCompleter &completer, std::string_view str) override
(Un)register a command completer, used to complete build-in Tcl cmds
void registerProxySetting(Setting &setting)
TclObject executeCommand(zstring_view command, CliConnection *connection=nullptr) override
Execute the given command.
void unregisterProxySetting(Setting &setting)
void unregisterSetting(Setting &setting) override
SettingsConfig & getSettingsConfig()
SettingsManager & getSettingsManager()
InfoCommand & getOpenMSXInfoCommand()
void unregisterCompleter(CommandCompleter &completer, std::string_view str) override
void unregisterCommand(Command &command, std::string_view str) override
bool isComplete(zstring_view command)
Returns true iff the command is complete (all braces, quotes etc.
void source(const std::string &script)
Executes all defined auto commands.
~GlobalCommandController()
Contains the main loop of openMSX.
SettingsManager & getSettingsManager()
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions: