xtd.console - Reference Guide  0.0.1
Modern c++17 library to manage terminal on Windows, macOS and Linux.
xtd::basic_console< Char > Class Template Referencefinal

Represents the standard input, output, and error streams for console applications. More...

#include <basic_console.hpp>

Static Public Member Functions

static console_color background_color () noexcept
 Gets the background color of the console. More...
 
static bool background_color (console_color color) noexcept
 Sets the background color of the console. More...
 
static void beep () noexcept
 Plays the sound of a beep through the console speaker. More...
 
static bool beep (unsigned int frequency, unsigned int duration) noexcept
 Plays the sound of a beep of a specified frequency and duration through the console speaker. More...
 
static int buffer_height () noexcept
 Gets the height of the buffer area. More...
 
static bool buffer_height (int height) noexcept
 Gets or sets the height of the buffer area. More...
 
static int buffer_width () noexcept
 Gets the width of the buffer area. More...
 
static bool buffer_width (int width) noexcept
 Sets the width of the buffer area. More...
 
static bool caps_lock () noexcept
 Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. More...
 
static bool clear () noexcept
 Clears the console buffer and corresponding console window of display information. More...
 
static int cursor_left () noexcept
 Gets the column position of the cursor within the buffer area. More...
 
static bool cursor_left (int left) noexcept
 Sets the column position of the cursor within the buffer area. More...
 
static int cursor_size () noexcept
 Gets or sets the height of the cursor within a character cell. More...
 
static void cursor_size (int size) noexcept
 Sets the height of the cursor within a character cell. More...
 
static int cursor_top () noexcept
 Gets the row position of the cursor within the buffer area. More...
 
static bool cursor_top (int top) noexcept
 Sets the row position of the cursor within the buffer area. More...
 
static bool cursor_visible () noexcept
 Gets a value indicating whether the cursor is visible. More...
 
static void cursor_visible (bool visible) noexcept
 Sets a value indicating whether the cursor is visible. More...
 
static console_color foreground_color () noexcept
 Gets the foreground color of the console. More...
 
static bool foreground_color (console_color color) noexcept
 Sets the foreground color of the console. More...
 
static int input_code_page () noexcept
 Gets the code page the console uses to read input. More...
 
static bool input_code_page (int code_page) noexcept
 Sets the code page the console uses to read input. More...
 
static bool is_error_redireted () noexcept
 Gets a value that indicates whether the error output stream has been redirected from the standard error stream. More...
 
static bool is_in_redireted () noexcept
 Gets a value that indicates whether the input stream has been redirected from the standard input stream. More...
 
static bool is_out_redireted () noexcept
 Gets a value that indicates whether the output stream has been redirected from the standard output stream. More...
 
static std::basic_ostream< Char > open_standard_error () noexcept
 Acquires the standard error stream. More...
 
static std::basic_istream< Char > open_standard_input () noexcept
 Acquires the standard input stream. More...
 
static std::basic_ostream< Char > open_standard_output () noexcept
 Acquires the standard output stream. More...
 
static int output_code_page () noexcept
 Gets the code page the console uses to write output. More...
 
static bool output_code_page (int code_page) noexcept
 Sets the code page the console uses to write output. More...
 
static std::basic_string< Char > read_line () noexcept
 
static bool reset_color () noexcept
 
static bool set_cursor_position (int left, int top) noexcept
 
static void set_error (const std::ostream &os) noexcept
 
static void set_in (const std::istream &is) noexcept
 
static void set_out (const std::ostream &os) noexcept
 
static std::map< int, console_special_keysignal_keys () noexcept
 
static int window_height () noexcept
 
static int window_left () noexcept
 
static int window_top () noexcept
 
static int window_width () noexcept
 
template<typename Arg >
static void write (Arg &&arg) noexcept
 
template<typename ... Args>
static void write (const std::basic_string< Char > &fmt, Args &&... args) noexcept
 
static void write_line () noexcept
 
template<typename Arg >
static void write_line (Arg &&arg) noexcept
 
template<typename ... Args>
static void write_line (const std::basic_string< Char > &fmt, Args &&... args) noexcept
 

Static Public Attributes

static std::basic_ostream< Char > error
 Gets the error output stream. A std::basic_ostream<Char> that represents the error output stream. More...
 
static std::basic_istream< Char > in
 Gets the standard input stream. A std::basic_istream<Char> that represents the standard input stream. More...
 
static std::basic_ostream< Char > out
 Gets the standard output stream. A std::basic_ostream<Char> that represents the standard output stream. More...
 

Detailed Description

template<class Char>
class xtd::basic_console< Char >

Represents the standard input, output, and error streams for console applications.

Remarks
This class cannot be inherited.
Examples
The following example demonstrates how to read data from, and write data to, the standard input and output streams. Note that these streams can be redirected by using the set_in and set_out methods.

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