NeoVision
A "modern" take on the turbovision tui library.
Public Member Functions | Static Public Member Functions | List of all members
neovision::IO Class Reference

Input/Output. More...

#include <crt.h>

Public Member Functions

 IO ()
 Default constructor. More...
 
 IO (IO const &)=delete
 Copy constructor (deleted). More...
 
void operator= (IO const &)=delete
 Assignment operator (deleted). More...
 
std::reference_wrapper< std::istream > InputStream ()
 Get input stream. More...
 
void SetInputStream (std::istream &stream)
 Sets the current input stream. More...
 
void SetOutputStream (std::ostream &stream)
 Sets the current output stream. More...
 
void Write (const std::string &str)
 Write output. More...
 

Static Public Member Functions

static IOGet ()
 Get singleton instance. More...
 

Detailed Description

Input/Output.

Internal singleton class to hold parameters and functions for thread-safe text input and output.

You typically shouldn't have to interact with this unless you want to change the output (or input) stream. For instance, if you were to want to output to stderr, you could do the following:

IO::get().SetOutputStream(std::cerr);

Definition at line 141 of file crt.h.

Constructor & Destructor Documentation

◆ IO() [1/2]

neovision::IO::IO ( )

Default constructor.

Definition at line 58 of file crt.cpp.

◆ IO() [2/2]

neovision::IO::IO ( IO const &  )
delete

Copy constructor (deleted).

Member Function Documentation

◆ Get()

IO & neovision::IO::Get ( )
static

Get singleton instance.

Returns
Returns an instance of OutputParameters.

Definition at line 62 of file crt.cpp.

Here is the caller graph for this function:

◆ InputStream()

std::reference_wrapper<std::istream> neovision::IO::InputStream ( )

Get input stream.

This function provides low-level access to the current input stream.

Warning
You must use LockInputStream/UnlockInputStream around this call.
Returns
Returns a reference to the current input stream.

◆ operator=()

void neovision::IO::operator= ( IO const &  )
delete

Assignment operator (deleted).

◆ SetInputStream()

void neovision::IO::SetInputStream ( std::istream &  stream)

Sets the current input stream.

StdIn (std::cin) is the default input stream. This allows you to to override this to any input stream.

Parameters
streamThe new input stream to be used for text output.

Definition at line 68 of file crt.cpp.

◆ SetOutputStream()

void neovision::IO::SetOutputStream ( std::ostream &  stream)

Sets the current output stream.

StdOut (std::cout) is the default output stream. This allows you to to override this to any output stream.

Parameters
streamThe new output stream to be used for text output.

Definition at line 74 of file crt.cpp.

◆ Write()

void neovision::IO::Write ( const std::string &  str)

Write output.

Writes given string to the configured output stream.

Parameters
strString to write to output stream.

Definition at line 80 of file crt.cpp.

Here is the caller graph for this function:

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