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>
6#include <string>
7#include <vector>
8
9namespace openmsx {
10
11class TclObject;
12class Interpreter;
13class InfoCommand;
14
15class InfoTopic : public Completer
16{
17public:
18 InfoTopic(const InfoTopic&) = delete;
19 InfoTopic& operator=(const InfoTopic&) = delete;
20
29 virtual void execute(std::span<const TclObject> tokens,
30 TclObject& result) const = 0;
31
36 [[nodiscard]] std::string help(std::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
48protected:
49 InfoTopic(InfoCommand& infoCommand, const std::string& name);
50 ~InfoTopic();
51
52private:
53 InfoCommand& infoCommand;
54};
55
56} // namespace openmsx
57
58#endif
void tabCompletion(std::vector< std::string > &tokens) const override
Attempt tab completion for this topic.
Definition InfoTopic.cc:18
InfoTopic(const InfoTopic &)=delete
std::string help(std::span< const TclObject > tokens) const override=0
Print help for this topic.
InfoTopic & operator=(const InfoTopic &)=delete
virtual void execute(std::span< const TclObject > tokens, TclObject &result) const =0
Show info on this topic.
Interpreter & getInterpreter() const final
Definition InfoTopic.cc:23
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.