openMSX
CommandController.hh
Go to the documentation of this file.
1#ifndef COMMANDCONTROLLER_HH
2#define COMMANDCONTROLLER_HH
3
4#include "TclObject.hh"
5#include "zstring_view.hh"
6#include <string_view>
7
8namespace openmsx {
9
10class CommandCompleter;
11class Command;
12class CliConnection;
13class Setting;
14class BaseSetting;
15class CliComm;
16class Interpreter;
17
19{
20public:
24 virtual void registerCompleter(CommandCompleter& completer,
25 std::string_view str) = 0;
26 virtual void unregisterCompleter(CommandCompleter& completer,
27 std::string_view str) = 0;
28
32 virtual void registerCommand(Command& command,
33 zstring_view str) = 0;
34 virtual void unregisterCommand(Command& command,
35 std::string_view str) = 0;
36
41 CliConnection* connection = nullptr) = 0;
42
45 virtual void registerSetting(Setting& setting) = 0;
46 virtual void unregisterSetting(Setting& setting) = 0;
47
48 virtual CliComm& getCliComm() = 0;
50
51protected:
52 CommandController() = default;
53 ~CommandController() = default;
54};
55
56} // namespace openmsx
57
58#endif
BaseSetting * setting
virtual void registerCommand(Command &command, zstring_view str)=0
(Un)register a command
virtual Interpreter & getInterpreter()=0
virtual CliComm & getCliComm()=0
virtual void unregisterCommand(Command &command, std::string_view str)=0
virtual void registerCompleter(CommandCompleter &completer, std::string_view str)=0
(Un)register a command completer, used to complete build-in Tcl cmds
virtual void registerSetting(Setting &setting)=0
TODO.
virtual TclObject executeCommand(zstring_view command, CliConnection *connection=nullptr)=0
Execute the given command.
virtual void unregisterSetting(Setting &setting)=0
virtual void unregisterCompleter(CommandCompleter &completer, std::string_view str)=0
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:9