ZNC
trunk
|
A helper class for handling commands in modules. More...
#include <Modules.h>
Public Types | |
typedef void(CModule::* | ModCmdFunc )(const CString &sLine) |
Type for the callback function that handles the actual command. More... | |
Public Member Functions | |
CModCommand () | |
Default constructor, needed so that this can be saved in a std::map. More... | |
CModCommand (const CString &sCmd, ModCmdFunc func, const CString &sArgs, const CString &sDesc) | |
Construct a new CModCommand. More... | |
CModCommand (const CModCommand &other) | |
Copy constructor, needed so that this can be saved in a std::map. More... | |
CModCommand & | operator= (const CModCommand &other) |
Assignment operator, needed so that this can be saved in a std::map. More... | |
void | AddHelp (CTable &Table) const |
Add this command to the CTable instance. More... | |
const CString & | GetCommand () const |
ModCmdFunc | GetFunction () const |
const CString & | GetArgs () const |
const CString & | GetDescription () const |
void | Call (CModule *pMod, const CString &sLine) const |
Static Public Member Functions | |
static void | InitHelp (CTable &Table) |
Initialize a CTable so that it can be used with AddHelp(). More... | |
A helper class for handling commands in modules.
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, |
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 CModCommand & | other | ) |
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 |
|
static |
CModCommand& CModCommand::operator= | ( | const CModCommand & | other | ) |
Assignment operator, needed so that this can be saved in a std::map.
other | Object to copy from. |