OpenTTD Source  20240919-master-gdf0233f4c2
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 62 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 193 of file console.cpp.

References 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 182 of file console.cpp.

◆ 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 170 of file console.cpp.

References 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 160 of file console.cpp.


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