semf
|
Wrapper class for shell command. The user has to create object of this class for adding their functionality to the shell. More...
#include <command.h>
Public Member Functions | |
Command (std::string_view name, std::string_view help, SlotBase< int, char **, Printer &, int & > &callback, Shell &esh) | |
Constructor. Adds the command to its shell. More... | |
Command (std::string_view name, std::string_view help, Shell &esh) | |
Constructor. Adds the command to its shell, without providing a callback immediately. More... | |
Command (std::string_view name, std::string_view help) | |
Constructor. Adds the command to its shell, without providing a callback immediately. More... | |
Command (const Command &other)=delete | |
virtual | ~Command ()=default |
std::string_view | name () const |
Returns the command's name. More... | |
std::string_view | help () const |
Returns the command's help text. More... | |
SEMF_SIGNAL (command, int, char **, Printer &, int &) | |
Public Member Functions inherited from semf::LinkedList< T >::Node | |
virtual | ~Node ()=default |
T * | next () const |
Returns a pointer to the next element in a list. More... | |
void | setNext (T *next) |
Sets a pointer to the next element in a list. More... | |
T * | previous () const |
Returns a pointer to the previous element in a list. More... | |
void | setPrevious (T *previous) |
Sets a pointer to the previous element in a list. More... | |
bool | isInAList () |
Returns if a node is part of a LinkedList . More... | |
Wrapper class for shell command. The user has to create object of this class for adding their functionality to the shell.
semf::esh::Command::Command | ( | std::string_view | name, |
std::string_view | help, | ||
SlotBase< int, char **, Printer &, int & > & | callback, | ||
Shell & | esh | ||
) |
Constructor. Adds the command to its shell.
name | Name of the command. Sending the name via to the shell triggers this command. |
help | Help description. |
callback | Callback slot. |
esh | The shell this command belongs to. |
Definition at line 15 of file command.cpp.
semf::esh::Command::Command | ( | std::string_view | name, |
std::string_view | help, | ||
Shell & | esh | ||
) |
Constructor. Adds the command to its shell, without providing a callback immediately.
name | Name of the command. Sending the name via to the shell triggers this command. |
help | Help description. |
esh | The shell this command belongs to. |
Definition at line 21 of file command.cpp.
semf::esh::Command::Command | ( | std::string_view | name, |
std::string_view | help | ||
) |
Constructor. Adds the command to its shell, without providing a callback immediately.
name | Name of the command. Sending the name via to the shell triggers this command. |
help | Help description. |
Definition at line 27 of file command.cpp.
|
delete |
|
virtualdefault |
std::string_view semf::esh::Command::help | ( | ) | const |
Returns the command's help text.
Definition at line 37 of file command.cpp.
std::string_view semf::esh::Command::name | ( | ) | const |
semf::esh::Command::SEMF_SIGNAL | ( | command | , |
int | , | ||
char ** | , | ||
Printer & | , | ||
int & | |||
) |
Gets emitted when the command is about to be executed.