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 "string_ref.hh"
6 
7 namespace openmsx {
8 
9 class CommandCompleter;
10 class Command;
11 class CliConnection;
12 class Setting;
13 class BaseSetting;
14 class CliComm;
15 class Interpreter;
16 
18 {
19 public:
23  virtual void registerCompleter(CommandCompleter& completer,
24  string_ref str) = 0;
25  virtual void unregisterCompleter(CommandCompleter& completer,
26  string_ref str) = 0;
27 
31  virtual void registerCommand(Command& command,
32  const std::string& str) = 0;
33  virtual void unregisterCommand(Command& command,
34  string_ref str) = 0;
35 
39  virtual bool hasCommand(string_ref command) const = 0;
40 
44  virtual TclObject executeCommand(const std::string& command,
45  CliConnection* connection = nullptr) = 0;
46 
49  virtual void registerSetting(Setting& setting) = 0;
50  virtual void unregisterSetting(Setting& setting) = 0;
51 
52  virtual CliComm& getCliComm() = 0;
53  virtual Interpreter& getInterpreter() = 0;
54 
55 protected:
58 };
59 
60 } // namespace openmsx
61 
62 #endif
virtual void unregisterCompleter(CommandCompleter &completer, string_ref str)=0
virtual void unregisterSetting(Setting &setting)=0
virtual void registerCommand(Command &command, const std::string &str)=0
(Un)register a command
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
virtual TclObject executeCommand(const std::string &command, CliConnection *connection=nullptr)=0
Execute the given command.
virtual Interpreter & getInterpreter()=0
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual void unregisterCommand(Command &command, string_ref str)=0
virtual void registerSetting(Setting &setting)=0
TODO.
virtual CliComm & getCliComm()=0
virtual void registerCompleter(CommandCompleter &completer, string_ref str)=0
(Un)register a command completer, used to complete build-in Tcl cmds
virtual bool hasCommand(string_ref command) const =0
Does a command with this name already exist?