V-Gears 0
Free Final Fantasy VII engine.
ConfigCmdHandler Class Reference

A handler for configuration commands. More...

#include <ConfigCmdHandler.h>

Inheritance diagram for ConfigCmdHandler:
Collaboration diagram for ConfigCmdHandler:

Public Member Functions

 ConfigCmdHandler ()
 Constructor. More...
 
 ~ConfigCmdHandler ()
 Destructor. More...
 
void AddCommand (const Ogre::String &name, const Ogre::String &description, const Ogre::String &params_description, ConfigCmdParams params, ConfigCmdCompletion completion)
 Adds a command to the manager. More...
 
void ExecuteString (const Ogre::String &cmd_string)
 Executes a command. More...
 
ConfigCmdFind (const Ogre::String &name) const
 Finds a command by name. More...
 
int GetConfigCmdNumber ()
 Counts the commands in the manager. More...
 
ConfigCmdGetConfigCmd (unsigned int i) const
 Retrieves a command by index. More...
 

Private Member Functions

 ConfigCmdHandler (const ConfigCmdHandler &rhs)=delete
 Forbidden copy constructor. More...
 
ConfigCmdHandler operator= (const ConfigCmdHandler &rhs)=delete
 Forbidden copy constructor. More...
 
void InitCmd ()
 Initializes the command. More...
 

Private Attributes

std::vector< std::unique_ptr< ConfigCmd > > commands_
 List of command in the manager. More...
 

Detailed Description

A handler for configuration commands.

Constructor & Destructor Documentation

◆ ConfigCmdHandler() [1/2]

ConfigCmdHandler::ConfigCmdHandler ( )

Constructor.

◆ ~ConfigCmdHandler()

ConfigCmdHandler::~ConfigCmdHandler ( )

Destructor.

◆ ConfigCmdHandler() [2/2]

ConfigCmdHandler::ConfigCmdHandler ( const ConfigCmdHandler rhs)
privatedelete

Forbidden copy constructor.

Parameters
[in]rhsManager to not copy.

Member Function Documentation

◆ AddCommand()

void ConfigCmdHandler::AddCommand ( const Ogre::String &  name,
const Ogre::String &  description,
const Ogre::String &  params_description,
ConfigCmdParams  params,
ConfigCmdCompletion  completion 
)

Adds a command to the manager.

Parameters
[in]nameCommand name.
[in]descriptionCommand description.
[in]params_descriptionCommand parameters description.
[in]paramsCommand parameter list.
[in]completionCommand completion list.

◆ ExecuteString()

void ConfigCmdHandler::ExecuteString ( const Ogre::String &  cmd_string)

Executes a command.

Parameters
[in]cmd_stringThe command, in string format.

◆ Find()

ConfigCmd * ConfigCmdHandler::Find ( const Ogre::String &  name) const

Finds a command by name.

Parameters
[in]nameName of the command.
Returns
The command by the name, or nullptr if there is none.

◆ GetConfigCmd()

ConfigCmd * ConfigCmdHandler::GetConfigCmd ( unsigned int  i) const

Retrieves a command by index.

A command index is the position at which it was added to the manager.

◆ GetConfigCmdNumber()

int ConfigCmdHandler::GetConfigCmdNumber ( )

Counts the commands in the manager.

Returns
The total number of commands

◆ InitCmd()

void ConfigCmdHandler::InitCmd ( )
private

Initializes the command.

Initializes all available commands.

Must be called from the constructor.

◆ operator=()

ConfigCmdHandler ConfigCmdHandler::operator= ( const ConfigCmdHandler rhs)
privatedelete

Forbidden copy constructor.

Parameters
[in]rhsManager to not copy.

Member Data Documentation

◆ commands_

std::vector<std::unique_ptr<ConfigCmd> > ConfigCmdHandler::commands_
private

List of command in the manager.


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