FS2_Open
Open source remastering of the Freespace 2 engine
debug_command Class Reference

Class to aggregate a debug command with its name (as shown in the console) and short help. More...

#include <console.h>

Public Member Functions

 debug_command ()
 
 debug_command (const char *name, const char *help, void(*func)())
 Adds a debug command to the debug_commands map, if it isn't in there already. More...
 

Public Attributes

const char * name
 The name of the command, as shown in the debug console. More...
 
const char * help
 The short help string, as shown by 'help <command>'. More...
 
void(* func )()
 Pointer to the function that to run when this command is evoked. More...
 

Detailed Description

Class to aggregate a debug command with its name (as shown in the console) and short help.

Note: Long help, as evoked by '<command> help', should be handled by the function itself. It is recommended that arguments that have sub-arguments be in their own function, so as to aide in organization and to keep the size of the command function down.

Definition at line 221 of file console.h.

Constructor & Destructor Documentation

debug_command::debug_command ( )

Definition at line 37 of file consolecmds.cpp.

debug_command::debug_command ( const char *  name,
const char *  help,
void(*)()  func 
)

Adds a debug command to the debug_commands map, if it isn't in there already.

The DCF macro more or less guarantees that a command won't be duplicated on compile time. But no harm in some extra caution.

Definition at line 41 of file consolecmds.cpp.

Member Data Documentation

void(* debug_command::func) ()

Pointer to the function that to run when this command is evoked.

Definition at line 225 of file console.h.

const char* debug_command::help

The short help string, as shown by 'help <command>'.

Definition at line 224 of file console.h.

const char* debug_command::name

The name of the command, as shown in the debug console.

Definition at line 223 of file console.h.


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