lintel 0.2.0
Loading...
Searching...
No Matches
CommandLineComponent.h
Go to the documentation of this file.
1#ifndef LINTEL_COMMANDLINECOMPONENT_H
2#define LINTEL_COMMANDLINECOMPONENT_H
3
4#include <memory>
5#include <set>
6#include <string>
7#include <string_view>
8#include <vector>
9
11
12namespace lintel {
13class UserDto;
14
17{
18private:
19 std::string_view m_name;
20 std::string_view m_alias;
21
22public:
25 CommandLineComponent(std::string_view name, std::string_view alias);
26
27 virtual ~CommandLineComponent() = default;
28
30 std::string_view getName();
31
33 std::string_view getAlias();
34
36 virtual void
37 onCommand(const UserDto &userDto, const std::string &command, const std::vector<std::string> &parameters) = 0;
38
40 virtual void onHelp() = 0;
41
43 virtual void onShowMenu() = 0;
44
53 virtual bool onMenu(const std::string &component) = 0;
54
60 virtual bool onExit() = 0;
61
63 virtual void printCommandList(std::set<std::string> menuAlias) = 0;
64
71 virtual std::set<std::string> menuEntriesOf() { return {}; }
72
74 virtual std::vector<std::string> allCommandsOf() = 0;
75};
76
77}// namespace lintel
78#endif// LINTEL_COMMANDLINECOMPONENT_H
Definition CommandLineComponent.h:17
virtual std::vector< std::string > allCommandsOf()=0
std::string_view getAlias()
virtual ~CommandLineComponent()=default
CommandLineComponent(std::string_view name, std::string_view alias)
std::string_view getName()
virtual bool onMenu(const std::string &component)=0
virtual void onShowMenu()=0
virtual void onCommand(const UserDto &userDto, const std::string &command, const std::vector< std::string > &parameters)=0
virtual void printCommandList(std::set< std::string > menuAlias)=0
virtual std::set< std::string > menuEntriesOf()
Definition CommandLineComponent.h:71
Definition UserDto.h:16
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9