Gorgon Game Engine
InputProvider Class Referenceabstract
Inheritance diagram for InputProvider:
[legend]

Public Types

enum  Dialect { Console, Programming, Intermediate, Binary }
 

Public Member Functions

 InputProvider (Dialect dialect)
 
Dialect GetDialect () const
 Returns the current dialect of the input. More...
 
std::string GetName () const
 
virtual bool IsInteractive () const
 Returns if this input provider allows interaction. More...
 
virtual bool ReadLine (std::string &, bool newline)=0
 This method should read a single physical line from the source. More...
 
virtual void Reset ()=0
 Resets the input to the beginning. More...
 
void SetDialect (Dialect dialect)
 Changes the current dialect of the input. More...
 

Protected Member Functions

virtual void checkdialect ()
 

Protected Attributes

Dialect dialect
 
std::string name
 

Member Enumeration Documentation

◆ Dialect

enum Dialect
Enumerator
Console 
Programming 
Intermediate 
Binary 

Constructor & Destructor Documentation

◆ InputProvider()

InputProvider ( Dialect  dialect)

Member Function Documentation

◆ checkdialect()

virtual void checkdialect ( )
protectedvirtual

Reimplemented in ConsoleInput.

◆ GetDialect()

Dialect GetDialect ( ) const

Returns the current dialect of the input.

References InputProvider::dialect.

◆ GetName()

std::string GetName ( ) const

References InputProvider::name.

◆ IsInteractive()

virtual bool IsInteractive ( ) const
virtual

Returns if this input provider allows interaction.

Reimplemented in ConsoleInput.

◆ ReadLine()

virtual bool ReadLine ( std::string &  ,
bool  newline 
)
pure virtual

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.

Implemented in StreamInput, and ConsoleInput.

◆ Reset()

virtual void Reset ( )
pure virtual

Resets the input to the beginning.

Implemented in StreamInput, and ConsoleInput.

◆ SetDialect()

void SetDialect ( Dialect  dialect)

Changes the current dialect of the input.

References InputProvider::checkdialect(), and InputProvider::dialect.

Member Data Documentation

◆ dialect

Dialect dialect
protected

◆ name

std::string name
protected

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