1 #ifndef GLOBALCOMMANDCONTROLLER_HH
2 #define GLOBALCOMMANDCONTROLLER_HH
20 class EventDistributor;
54 void source(
const std::string& script);
64 std::string_view str)
override;
66 std::string_view str)
override;
70 std::string_view str)
override;
81 [[nodiscard]] std::string
tabCompletion(std::string_view command);
97 std::vector<std::pair<std::unique_ptr<ProxySetting>,
unsigned>>;
98 ProxySettings::iterator findProxySetting(std::string_view name);
110 struct HelpCmd final :
Command {
113 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
114 void tabCompletion(std::vector<std::string>& tokens)
const override;
117 struct TabCompletionCmd final : Command {
120 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
123 struct UpdateCmd final : Command {
126 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
127 void tabCompletion(std::vector<std::string>& tokens)
const override;
132 struct PlatformInfo final : InfoTopic {
133 explicit PlatformInfo(InfoCommand& openMSXInfoCommand);
135 TclObject& result)
const override;
136 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
139 struct VersionInfo final : InfoTopic {
140 explicit VersionInfo(InfoCommand& openMSXInfoCommand);
142 TclObject& result)
const override;
143 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
146 RomInfoTopic romInfoTopic;
148 struct NameFromProxy {
149 template<
typename Pair>
150 [[nodiscard]]
const std::string& operator()(
const Pair& p)
const {
151 return p.second->getName();
155 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: