openMSX
InfoTopic.hh
Go to the documentation of this file.
1 #ifndef INFOTOPIC_HH
2 #define INFOTOPIC_HH
3 
4 #include "Completer.hh"
5 #include "span.hh"
6 #include <string>
7 #include <vector>
8 
9 namespace openmsx {
10 
11 class TclObject;
12 class Interpreter;
13 class InfoCommand;
14 
15 class InfoTopic : public Completer
16 {
17 public:
26  virtual void execute(span<const TclObject> tokens,
27  TclObject& result) const = 0;
28 
33  std::string help(const std::vector<std::string>& tokens) const override = 0;
34 
41  void tabCompletion(std::vector<std::string>& tokens) const override;
42 
43  Interpreter& getInterpreter() const final;
44 
45 protected:
46  InfoTopic(InfoCommand& infoCommand, const std::string& name);
47  ~InfoTopic();
48 
49 private:
50  InfoCommand& infoCommand;
51 };
52 
53 } // namespace openmsx
54 
55 #endif
Interpreter & getInterpreter() const final
Definition: InfoTopic.cc:26
void tabCompletion(std::vector< std::string > &tokens) const override
Attempt tab completion for this topic.
Definition: InfoTopic.cc:21
Definition: span.hh:34
std::string help(const std::vector< std::string > &tokens) const override=0
Print help for this topic.
InfoTopic(InfoCommand &infoCommand, const std::string &name)
Definition: InfoTopic.cc:9
virtual void execute(span< const TclObject > tokens, TclObject &result) const =0
Show info on this topic.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5