|
ZNC trunk
|
A helper class for handling commands in modules. More...
#include <Modules.h>
Inheritance diagram for CModCommand:
Collaboration diagram for CModCommand:Public Types | |
| typedef void(CModule::* | ModCmdFunc) (const CString &sLine) |
| Type for the callback function that handles the actual command. | |
| typedef std::function< void(const CString &sLine)> | CmdFunc |
Public Member Functions | |
| CModCommand () | |
| Default constructor, needed so that this can be saved in a std::map. | |
| CModCommand (const CString &sCmd, CModule *pMod, ModCmdFunc func, const CString &sArgs, const CString &sDesc) | |
| Construct a new CModCommand. | |
| CModCommand (const CString &sCmd, CmdFunc func, const COptionalTranslation &Args, const COptionalTranslation &Desc) | |
| CModCommand (const CModCommand &other)=default | |
| Copy constructor, needed so that this can be saved in a std::map. | |
| CModCommand & | operator= (const CModCommand &other)=default |
| Assignment operator, needed so that this can be saved in a std::map. | |
| void | AddHelp (CTable &Table) const |
| Add this command to the CTable instance. | |
| const CString & | GetCommand () const |
| CmdFunc | GetFunction () const |
| CString | GetArgs () const |
| CString | GetDescription () const |
| void | Call (const CString &sLine) const |
Static Public Member Functions | |
| static void | InitHelp (CTable &Table) |
| Initialize a CTable so that it can be used with AddHelp(). | |
A helper class for handling commands in modules.
| typedef std::function<void(const CString& sLine)> CModCommand::CmdFunc |
| typedef void(CModule::* CModCommand::ModCmdFunc) (const CString &sLine) |
Type for the callback function that handles the actual command.
| CModCommand::CModCommand | ( | ) |
Default constructor, needed so that this can be saved in a std::map.
| CModCommand::CModCommand | ( | const CString & | sCmd, |
| CModule * | pMod, | ||
| ModCmdFunc | func, | ||
| const CString & | sArgs, | ||
| const CString & | sDesc | ||
| ) |
Construct a new CModCommand.
| sCmd | The name of the command. |
| func | The command's callback function. |
| sArgs | Help text describing the arguments to this command. |
| sDesc | Help text describing what this command does. |
| CModCommand::CModCommand | ( | const CString & | sCmd, |
| CmdFunc | func, | ||
| const COptionalTranslation & | Args, | ||
| const COptionalTranslation & | Desc | ||
| ) |
|
default |
Copy constructor, needed so that this can be saved in a std::map.
| other | Object to copy from. |
| void CModCommand::AddHelp | ( | CTable & | Table | ) | const |
Add this command to the CTable instance.
| Table | Instance of CTable to which this should be added. |
|
inline |
|
inline |
|
inline |
|
inline |
References COptionalTranslation::Resolve().
|
inline |
|
static |
|
default |
Assignment operator, needed so that this can be saved in a std::map.
| other | Object to copy from. |