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:
18  InfoTopic(const InfoTopic&) = delete;
19  InfoTopic& operator=(const InfoTopic&) = delete;
20 
29  virtual void execute(span<const TclObject> tokens,
30  TclObject& result) const = 0;
31 
36  [[nodiscard]] std::string help(span<const TclObject> tokens) const override = 0;
37 
44  void tabCompletion(std::vector<std::string>& tokens) const override;
45 
46  [[nodiscard]] Interpreter& getInterpreter() const final;
47 
48 protected:
49  InfoTopic(InfoCommand& infoCommand, const std::string& name);
50  ~InfoTopic();
51 
52 private:
53  InfoCommand& infoCommand;
54 };
55 
56 } // namespace openmsx
57 
58 #endif
std::string help(span< const TclObject > tokens) const override=0
Print help for this topic.
void tabCompletion(std::vector< std::string > &tokens) const override
Attempt tab completion for this topic.
Definition: InfoTopic.cc:18
InfoTopic & operator=(const InfoTopic &)=delete
InfoTopic(const InfoTopic &)=delete
virtual void execute(span< const TclObject > tokens, TclObject &result) const =0
Show info on this topic.
Interpreter & getInterpreter() const final
Definition: InfoTopic.cc:23
Definition: span.hh:126
This file implemented 3 utility functions:
Definition: Autofire.cc:9