lintel 0.2.0
Loading...
Searching...
No Matches
PropertyCliComponent.h
Go to the documentation of this file.
1#ifndef LINTEL_PROPERTYCLICOMPONENT_H
2#define LINTEL_PROPERTYCLICOMPONENT_H
3
4#include <map>
5#include <memory>
6#include <string>
7
11
12namespace lintel {
15{
16private:
17 static constexpr std::string_view m_name = "Property";
18 static constexpr std::string_view m_alias = "Prop";
19 static constexpr std::string_view m_description =
20 "The component can be used to show and manipulate all kind of available "
21 "pmroperties.";
22 std::shared_ptr<PropertyApi> m_propertyApi;
23
24 // Commands
25 enum Commands { Undefined, ShowProperties, ShowProperty, UpdateProperty };
26
27 // Flags
28 std::optional<std::string> m_processName;
29 std::optional<std::string> m_className;
30 std::optional<std::string> m_instanceName;
31 std::optional<std::string> m_propertyName;
32 std::optional<std::string> m_value;
33
35
37 static void printProperties(const std::vector<PropertyDto> &properties);
38
40 static void printProperty(const std::optional<PropertyDto> &optionalProperty);
41
42public:
44 explicit PropertyCliComponent(std::shared_ptr<PropertyApi> propertyApi);
45
46 void onCommand(const UserDto &userDto, const std::string &input, const std::vector<std::string> &parameters) override;
47
48 void onHelp() override;
49
50 void onShowMenu() override;
51
52 bool onMenu(const std::string &component) override;
53
54 bool onExit() override;
55
56 void printCommandList(std::set<std::string> menuAlias) override;
57
58 std::vector<std::string> allCommandsOf() override;
59};
60
61}// namespace lintel
62#endif// LINTEL_PROPERTYCLICOMPONENT_H
Definition CommandLineComponent.h:17
Definition CommandParser.h:21
Definition PropertyCliComponent.h:15
std::vector< std::string > allCommandsOf() override
void onCommand(const UserDto &userDto, const std::string &input, const std::vector< std::string > &parameters) override
bool onMenu(const std::string &component) override
PropertyCliComponent(std::shared_ptr< PropertyApi > propertyApi)
void printCommandList(std::set< std::string > menuAlias) override
Definition UserDto.h:16
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9