mines
Loading...
Searching...
No Matches
Console Class Referenceexport
module mines

Terminal input/output handle. More...

Public Member Functions

 ~Console ()
 Reset the terminal to the original state.
std::optional< char > get_input (std::optional< std::chrono::milliseconds > timeout)
 Wait for and get next input.

Static Public Member Functions

static Console setup ()
 Initialize a terminal and construct a handle.

Detailed Description

Terminal input/output handle.

Abstracts input/output operations on the terminal.

Member Function Documentation

◆ get_input()

std::optional< char > Console::get_input ( std::optional< std::chrono::milliseconds > timeout)
inline

Wait for and get next input.

Parameters
timeoutMaximum time to wait for input, or no value to wait indefinitely.
Returns
Input as a single character from the keyboard, or no value if the timeout was reached.

◆ setup()

Console Console::setup ( )
inlinestatic

Initialize a terminal and construct a handle.

Sets up the terminal into a mode appropriate for a text-based user interface.

Returns
Handle to the initialized terminal.

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