ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CModCommand Class Reference

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...
 
CModCommandoperator= (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 CStringGetCommand () const
 
ModCmdFunc GetFunction () const
 
const CStringGetArgs () const
 
const CStringGetDescription () 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...
 

Detailed Description

A helper class for handling commands in modules.

Member Typedef Documentation

typedef void(CModule::* CModCommand::ModCmdFunc)(const CString &sLine)

Type for the callback function that handles the actual command.

Constructor & Destructor Documentation

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.

Parameters
sCmdThe name of the command.
funcThe command's callback function.
sArgsHelp text describing the arguments to this command.
sDescHelp text describing what this command does.
CModCommand::CModCommand ( const CModCommand other)

Copy constructor, needed so that this can be saved in a std::map.

Parameters
otherObject to copy from.

Member Function Documentation

void CModCommand::AddHelp ( CTable Table) const

Add this command to the CTable instance.

Parameters
TableInstance of CTable to which this should be added.
Warning
The Table should be initialized via InitHelp().
void CModCommand::Call ( CModule pMod,
const CString sLine 
) const
inline
const CString& CModCommand::GetArgs ( ) const
inline
const CString& CModCommand::GetCommand ( ) const
inline
const CString& CModCommand::GetDescription ( ) const
inline
ModCmdFunc CModCommand::GetFunction ( ) const
inline
static void CModCommand::InitHelp ( CTable Table)
static

Initialize a CTable so that it can be used with AddHelp().

Parameters
TableThe instance of CTable to initialize.
CModCommand& CModCommand::operator= ( const CModCommand other)

Assignment operator, needed so that this can be saved in a std::map.

Parameters
otherObject to copy from.

The documentation for this class was generated from the following file: