![]() |
Gorgon Game Engine
|
Reads lines from the console. More...
Public Member Functions | |
ConsoleInput (Dialect dialect=InputProvider::Console, const std::string &prompt="> ") | |
Initializes console input. line number will be appended at the start of the prompt. More... | |
virtual bool | IsInteractive () const override |
Returns if this input provider allows interaction. More... | |
virtual bool | ReadLine (std::string &input, bool newline) override final |
This method should read a single physical line from the source. More... | |
virtual void | Reset () override |
Resets the input to the beginning. More... | |
void | SetPrompt (const std::string &prompt) |
![]() | |
InputProvider (Dialect dialect) | |
Dialect | GetDialect () const |
Returns the current dialect of the input. More... | |
std::string | GetName () const |
void | SetDialect (Dialect dialect) |
Changes the current dialect of the input. More... | |
Protected Member Functions | |
virtual void | checkdialect () override |
Additional Inherited Members | |
![]() | |
enum | Dialect { Console, Programming, Intermediate, Binary } |
![]() | |
Dialect | dialect |
std::string | name |
Reads lines from the console.
ConsoleInput | ( | Dialect | dialect = InputProvider::Console , |
const std::string & | prompt = "> " |
||
) |
Initializes console input. line number will be appended at the start of the prompt.
References InputProvider::name.
|
overrideprotectedvirtual |
Reimplemented from InputProvider.
References InputProvider::Binary, InputProvider::Console, InputProvider::dialect, and InputProvider::SetDialect().
|
overridevirtual |
Returns if this input provider allows interaction.
Reimplemented from InputProvider.
|
finaloverridevirtual |
This method should read a single physical line from the source.
Logical line separation is handled by InputSource. Return of false means no input is fetched as it is finished. If there is a read error, rather than returning false, this function should throw. newline parameter denotes that this line is a new line, not continuation of another.
Implements InputProvider.
|
overridevirtual |
Resets the input to the beginning.
Implements InputProvider.
void SetPrompt | ( | const std::string & | prompt | ) |