CCommand: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Add a page for CCommand)
 
mNo edit summary
 
Line 18: Line 18:
; <code>const char *CCommand::GetCommandString()</code>
; <code>const char *CCommand::GetCommandString()</code>
: Returns the original command (the entire command in string form, including the 0th arg)
: Returns the original command (the entire command in string form, including the 0th arg)
[[Category:Programming]]
[[Category:Console]]

Latest revision as of 21:47, 8 July 2012

CCommand is a tokenizer used mainly in ConCommands.

It tokenizes a string like "say Valve Developer Community" to a series of arguments (args), in this case being:
Argument 0: say
Argument 1: Valve
Argument 2: Developer
Argument 3: Community

Functions

int CCommand::ArgC()
Returns number of arguments.
const char *CCommand::Arg( int nIndex )
Returns the argument nIndex of this CCommand.
const char *CCommand::ArgS()
Returns all args that occur after the 0th arg, in string form
const char *CCommand::GetCommandString()
Returns the original command (the entire command in string form, including the 0th arg)