#include <Console.h>
Public Member Functions | |
Console (std::string configFile, bool autolog=false) | |
Console (bool autolog=false) | |
void | addAction (const std::string &name, Action *action) |
void | addVariable (const std::string &name, Variable *variable) |
void | removeAction (const std::string &name) |
void | removeVariable (const std::string &name) |
void | output (const std::string &str) |
void | render () const |
void | parseStream (std::istream &is) |
bool | handleBinding (char c) |
void | handleChar (char c) |
void | handleBackspace () |
void | handleEnter () |
void | handleTab () |
void | handleDownArrow () |
void | handleUpArrow () |
void | saveLog (const std::string &filename) |
void | loadConfiguration (const std::string &filename) |
The console has 5 built-in commands:
"help" - lists all action commands currently present in the console.
"list" - lists all variables commands currently present in the console.
"save <filename>" - saves all variables currently present in the console and their values to the specified file.
"load <filename>" - loads a specified configuration file, and executes all lines in the configuration as a command.
"bind" - lists all bindings (between a character and a command) currently present in the console.
"bind <char>" - outputs the command associated with the specified character.
"bind <char> <command>" - make a binding between the specified character and the specified command. <command> can consists of a list of command parameters in addition to the command itself.
|
Constructs a console and executes the commands specified in the config file.
|
|
Constructs a console.
|
|
Adds an action to the console.
|
|
Adds a variable to the console.
|
|
Handles a backspace keystroke. |
|
Handles a binding for a specified character. The binding acts as a mapping between a single character and a command. A binding can be activated using the built-in console command "bind".
|
|
Handles a single character keystroke.
|
|
Handles a down arrow keystroke. |
|
Handles an enter keystroke. |
|
Handles a tab keystroke. |
|
Handles an up arrow keystroke. |
|
Loads a configuration from a specified file, and executes all lines in the configuration as a command.
|
|
Outputs a string in the console window.
|
|
Parses an input stream into lines, and executes all lines as a command.
|
|
Removes an action from the console.
|
|
Removes a variable from the console.
|
|
Renders the console to the screen using OpenGL. |
|
Saves the log to a file.
|