OpenTTD Source  12.0-beta2
IConsole Struct Reference

Public Types

typedef std::map< std::string, IConsoleCmdCommandList
 
typedef std::map< std::string, IConsoleAliasAliasList
 

Static Public Member Functions

static CommandList & Commands ()
 
static AliasList & Aliases ()
 
static void CmdRegister (const std::string &name, IConsoleCmdProc *proc, IConsoleHook *hook=nullptr)
 Register a new command to be used in the console. More...
 
static IConsoleCmdCmdGet (const std::string &name)
 Find the command pointed to by its string. More...
 
static void AliasRegister (const std::string &name, const std::string &cmd)
 Register a an alias for an already existing command in the console. More...
 
static IConsoleAliasAliasGet (const std::string &name)
 Find the alias pointed to by its string. More...
 

Detailed Description

Definition at line 63 of file console_internal.h.

Member Function Documentation

◆ AliasGet()

IConsoleAlias * IConsole::AliasGet ( const std::string &  name)
static

Find the alias pointed to by its string.

Parameters
namealias to be found
Returns
return Aliasstruct of the found alias, or nullptr on failure

Definition at line 201 of file console.cpp.

References CompanyProperties::name, and RemoveUnderscores().

Referenced by IConsoleCmdExec().

◆ AliasRegister()

void IConsole::AliasRegister ( const std::string &  name,
const std::string &  cmd 
)
static

Register a an alias for an already existing command in the console.

Parameters
namename of the alias that will be used
cmdname of the command that 'name' will be alias of

Definition at line 190 of file console.cpp.

References CC_ERROR, IConsolePrint(), CompanyProperties::name, and RemoveUnderscores().

◆ CmdGet()

IConsoleCmd * IConsole::CmdGet ( const std::string &  name)
static

Find the command pointed to by its string.

Parameters
namecommand to be found
Returns
return Cmdstruct of the found command, or nullptr on failure

Definition at line 178 of file console.cpp.

References CompanyProperties::name, and RemoveUnderscores().

Referenced by IConsoleCmdExec().

◆ CmdRegister()

void IConsole::CmdRegister ( const std::string &  name,
IConsoleCmdProc proc,
IConsoleHook *  hook = nullptr 
)
static

Register a new command to be used in the console.

Parameters
namename of the command that will be used
procfunction that will be called upon execution of command

Definition at line 168 of file console.cpp.


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