mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
Handles command parsing for a console and draws the console using OpenGL. More...
#include <Console.h>
Static Public Member Functions | |
static std::string | getCommand (std::string commandString) |
Retrieve a command from a command line input. | |
static char | getSingleCharacterOption (std::string commandString) |
Retrieve a single character option from a command line input. | |
static std::string | getOption (std::string commandString) |
Retrieve an option from a command line input. | |
Handles command parsing for a console and draws the console using OpenGL.
Provides some static functions to parse lines that are sent to the program as command lines. It contains a container that stores the last commands and can search through them. Also it can be tested if a command starts with a given string to implement auto filling for text input.
|
static |
Retrieve a command from a command line input.
Static function that returns the first word of an command string. If the command string only contains one word, this is returned. Only space works as separator for words.
commandString | A string that should be parsed |
Definition at line 18 of file Console.cpp.
|
static |
Retrieve an option from a command line input.
Returns the first option of an command. This option begins after the first space. The option must not contain any space characters.
commandString | The string whose options should be extracted. |
Definition at line 51 of file Console.cpp.
|
static |
Retrieve a single character option from a command line input.
Static function that gets one single character option of any command. It simply searchges the first space and returns the next character. If we only get pointers to character arrays which last item is zero, this will work. If the command string contains more characters they are ignored.
commandString | The string whose options are searched |
Definition at line 36 of file Console.cpp.