Gorgon Game Engine
StreamInput Class Reference

Reads lines from a stream. More...

Inheritance diagram for StreamInput:
[legend]

Public Member Functions

 StreamInput (std::istream &stream, Dialect dialect, const std::string &name="")
 
virtual bool ReadLine (std::string &input, bool) 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...
 
- Public Member Functions inherited from InputProvider
 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...
 
void SetDialect (Dialect dialect)
 Changes the current dialect of the input. More...
 

Additional Inherited Members

- Public Types inherited from InputProvider
enum  Dialect { Console, Programming, Intermediate, Binary }
 
- Protected Member Functions inherited from InputProvider
virtual void checkdialect ()
 
- Protected Attributes inherited from InputProvider
Dialect dialect
 
std::string name
 

Detailed Description

Reads lines from a stream.

Constructor & Destructor Documentation

◆ StreamInput()

StreamInput ( std::istream &  stream,
Dialect  dialect,
const std::string &  name = "" 
)

References InputProvider::name.

Member Function Documentation

◆ ReadLine()

virtual bool ReadLine ( std::string &  ,
bool  newline 
)
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.

◆ Reset()

virtual void Reset ( )
overridevirtual

Resets the input to the beginning.

Implements InputProvider.


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