Represents the standard input, output, and error streams for console applications.
Fields | |
| static std::ostream | error |
| Gets the error output stream. A std::basic_ostream<char_t> that represents the error output stream. More... | |
| static std::istream | in |
| Gets the standard input stream. A std::basic_istream<char_t> that represents the standard input stream. More... | |
| static std::ostream | out |
| Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output stream. More... | |
Properties | |
| static bool | auto_flush_out () |
| Gets a value indicating whether the xtd::console::out will flush its buffer to the underlying stream after every call to xtd::console::write and xtd::console::write_line. More... | |
| static void | auto_flush_out (bool value) |
| Sets a value indicating whether the xtd::console::out will flush its buffer to the underlying stream after every call to xtd::console::write and xtd::console::write_line. More... | |
| static console_color | background_color () |
| Gets the background color of the console. More... | |
| static void | background_color (console_color color) |
| Sets the background color of the console. More... | |
| static int32 | buffer_height () |
| Gets the height of the buffer area. More... | |
| static void | buffer_height (int32 height) |
| Sets or sets the height of the buffer area. More... | |
| static int32 | buffer_width () |
| Gets the width of the buffer area. More... | |
| static void | buffer_width (int32 width) |
| Sets the width of the buffer area. More... | |
| static bool | caps_lock () |
| Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. More... | |
| static int32 | cursor_left () |
| Gets the column position of the cursor within the buffer area. More... | |
| static void | cursor_left (int32 left) |
| Sets the column position of the cursor within the buffer area. More... | |
| static int32 | cursor_size () |
| Gets or sets the height of the cursor within a character cell. More... | |
| static void | cursor_size (int32 size) |
| Sets the height of the cursor within a character cell. More... | |
| static int32 | cursor_top () |
| Gets the row position of the cursor within the buffer area. More... | |
| static void | cursor_top (int32 top) |
| Sets the row position of the cursor within the buffer area. More... | |
| static bool | cursor_visible () |
| Gets a value indicating whether the cursor is visible. More... | |
| static void | cursor_visible (bool visible) |
| Sets a value indicating whether the cursor is visible. More... | |
| static console_color | foreground_color () |
| Gets the foreground color of the console. More... | |
| static bool | foreground_color (console_color color) |
| Sets the foreground color of the console. More... | |
| static int32 | input_code_page () |
| Gets the code page the console uses to read input. More... | |
| static bool | input_code_page (int32 code_page) |
| Sets the code page the console uses to read input. More... | |
| static bool | is_error_redirected () |
| Gets a value that indicates whether the error output stream has been redirected from the standard error stream. More... | |
| static bool | is_input_redirected () |
| Gets a value that indicates whether the input stream has been redirected from the standard input stream. More... | |
| static bool | is_output_redirected () |
| Gets a value that indicates whether the output stream has been redirected from the standard output stream. More... | |
| static bool | key_available () |
| Gets a value indicating whether a key press is available in the input stream. More... | |
| static int32 | largest_window_height () |
| Gets the largest possible number of console window rows, based on the current font and screen resolution. More... | |
| static int32 | largest_window_width () |
| Gets the largest possible number of console window columns, based on the current font and screen resolution. More... | |
| static bool | number_lock () |
| Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off. More... | |
| static int32 | output_code_page () |
| Gets the code page the console uses to write output. More... | |
| static bool | output_code_page (int32 code_page) |
| Sets the code page the console uses to write output. More... | |
| static xtd::ustring | title () |
| Gets the title to display in the console title bar. More... | |
| static void | title (const xtd::ustring &title) |
| Sets the title to display in the console title bar. More... | |
| static bool | treat_control_c_as_input () |
| Gets a value indicating whether the combination of the Control modifier key and C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system. More... | |
| static void | treat_control_c_as_input (bool treat_control_c_as_input) |
| Sets a value indicating whether the combination of the Control modifier key and C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system. More... | |
| static int32 | window_height () |
| Gets the height of the console window area. More... | |
| static void | window_height (int32 height) |
| Sets the height of the console window area. More... | |
| static int32 | window_left () |
| Gets the left of the console window area. More... | |
| static void | window_left (int32 left) |
| Sets the left of the console window area. More... | |
| static int32 | window_top () |
| Gets the top of the console window area. More... | |
| static void | window_top (int32 top) |
| Sets the top of the console window area. More... | |
| static int32 | window_width () |
| Gets the width of the console window area. More... | |
| static void | window_width (int32 width) |
| Sets the width of the console window area. More... | |
Events | |
| static event< console, console_cancel_event_handler > | cancel_key_press |
| Occurs when the Control modifier key (Ctrl) and either the ConsoleKey.C console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break). More... | |
Methods | |
| static void | beep () |
| Plays the sound of a beep through the console speaker. More... | |
| static void | beep (uint32 frequency, uint32 duration) |
| Plays the sound of a beep of a specified frequency and duration through the console speaker. More... | |
| static void | clear () |
| Clears the console buffer and corresponding console window of display information. More... | |
| static std::pair< int32, int32 > | get_cursor_position () |
| Gets the position of the cursor. More... | |
| static std::ostream | open_standard_error () |
| Acquires the standard error stream. More... | |
| static std::istream | open_standard_input () |
| Acquires the standard input stream. More... | |
| static std::ostream | open_standard_output () |
| Acquires the standard output stream. More... | |
| static int32 | read () |
| Reads the next character from the standard input stream. More... | |
| static console_key_info | read_key () |
| Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window. More... | |
| static console_key_info | read_key (bool intercept) |
| Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window. More... | |
| static xtd::ustring | read_line () |
| Reads the next line of characters from the standard input stream. More... | |
| static xtd::ustring | read_line (bool intercept) |
| Reads the next line of characters from the standard input stream. More... | |
| static bool | reset_color () |
| Sets the foreground and background console colors to their defaults. More... | |
| static void | set_cursor_position (int32 left, int32 top) |
| Sets the position of the cursor. More... | |
| static void | set_error (const std::ostream &os) |
| Sets the error property to the specified std::ostream object. More... | |
| static void | set_in (const std::istream &is) |
| Sets the int property to the specified std::istream object. More... | |
| static void | set_out (const std::ostream &os) |
| Sets the out property to the specified std::ostream object. More... | |
| static void | set_window_position (int32 left, int32 top) |
| Sets the position of the console window relative to the screen buffer. More... | |
| static void | set_window_size (int32 width, int32 height) |
| Sets the height and width of the console window to the specified values. More... | |
| template<typename arg_t > | |
| static void | write (arg_t &&value) |
| Writes the text representation of the specified value to the standard output stream. More... | |
| template<typename ... args_t> | |
| static void | write (const xtd::ustring &fmt, args_t &&... values) |
| Writes the text representation of the specified list of values to the standard output stream using the specified format information. More... | |
| static void | write_line () |
| Writes the current line terminator to the standard output stream using the specified format information. More... | |
| template<typename arg_t > | |
| static void | write_line (arg_t &&value) |
| Writes the text representation of the specified value, followed by the current line terminator, to the standard output stream. More... | |
| template<typename ... args_t> | |
| static void | write_line (const xtd::ustring &fmt, args_t &&... values) |
| Writes the text representation of the specified list of values, followed by the current line terminator, to the standard output stream using the specified format information. More... | |
|
static |
Gets a value indicating whether the xtd::console::out will flush its buffer to the underlying stream after every call to xtd::console::write and xtd::console::write_line.
|
static |
Sets a value indicating whether the xtd::console::out will flush its buffer to the underlying stream after every call to xtd::console::write and xtd::console::write_line.
| value | true to force xtd::console::out to flush its buffer; otherwise, false. The default value is true. |
|
static |
Gets the background color of the console.
|
static |
Sets the background color of the console.
| color | A xtd::console_color that specifies the background color of the console; that is, the color that appears behind each character. |
| xtd::argument_exception | The color specified in a set operation is not a valid member of xtd::console_color. |
|
static |
Plays the sound of a beep through the console speaker.
Plays the sound of a beep of a specified frequency and duration through the console speaker.
| frequency | The frequency of the beep, ranging from 37 to 32767 hertz |
| duration | The duration of the beep measured in milliseconds |
|
static |
Gets the height of the buffer area.
|
static |
Sets or sets the height of the buffer area.
| height | The current height, in rows, of the buffer area. |
| xtd::argument_out_of_range_exception | The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to xtd::int16_object::max_value. |
|
static |
Gets the width of the buffer area.
|
static |
Sets the width of the buffer area.
| width | The current width, in columns, of the buffer area. |
| xtd::argument_out_of_range_exception | The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to xtd::int16_object::max_value. |
|
static |
Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off.
|
static |
Clears the console buffer and corresponding console window of display information.
|
static |
Gets the column position of the cursor within the buffer area.
|
static |
Sets the column position of the cursor within the buffer area.
| left | The current position, in columns, of the cursor. |
| xtd::argument_out_of_range_exception | The value in a set operation is less than zero -or- The value in a set operation is greater than or equal to xtd::console::buffer_width. |
|
static |
Gets or sets the height of the cursor within a character cell.
|
static |
Sets the height of the cursor within a character cell.
| size | The size of the cursor expressed as a percentage of the height of a character cell. The property value ranges from 1 to 100. |
| xtd::argument_out_of_range_exception | The value specified in a set operation is less than 1 or greater than 100. |
|
static |
Gets the row position of the cursor within the buffer area.
|
static |
Sets the row position of the cursor within the buffer area.
| top | The current position, in rows, of the cursor. |
| xtd::argument_out_of_range_exception | The value in a set operation is less than zero -or- The value in a set operation is greater than or equal to xtd::console::buffer_height. |
|
static |
Gets a value indicating whether the cursor is visible.
|
static |
Sets a value indicating whether the cursor is visible.
| visible | true if the cursor is visible; otherwise, false. |
|
static |
Gets the foreground color of the console.
|
static |
Sets the foreground color of the console.
| color | A console_color that specifies the foreground color of the console; that is, the color of each character that is displayed. |
| xtd::argument_exception | The color specified in a set operation is not a valid member of xtd::console_color. |
Gets the position of the cursor.
|
static |
Gets the code page the console uses to read input.
|
static |
Sets the code page the console uses to read input.
| code_page | The code page used to read console input. |
|
static |
Gets a value that indicates whether the error output stream has been redirected from the standard error stream.
| true | if error output is redirected; otherwise, false. |
|
static |
Gets a value that indicates whether the input stream has been redirected from the standard input stream.
| true | if input is redirected; otherwise, false. |
|
static |
Gets a value that indicates whether the output stream has been redirected from the standard output stream.
| true | if output is redirected; otherwise, false. |
|
static |
Gets a value indicating whether a key press is available in the input stream.
|
static |
Gets the largest possible number of console window rows, based on the current font and screen resolution.
| The | height of the largest possible console window measured in rows. |
|
static |
Gets the largest possible number of console window columns, based on the current font and screen resolution.
| The | width of the largest possible console window measured in columns. |
|
static |
Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off.
| true | if NUM LOCK is turned on; false if NUM LOCK is turned off. |
|
static |
Acquires the standard error stream.
|
static |
Acquires the standard input stream.
|
static |
Acquires the standard output stream.
|
static |
Gets the code page the console uses to write output.
|
static |
Sets the code page the console uses to write output.
| code_page | The code page used to write console output. |
|
static |
Reads the next character from the standard input stream.
|
static |
Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window.
|
static |
Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window.
| intercept | Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false |
|
static |
Reads the next line of characters from the standard input stream.
|
static |
Reads the next line of characters from the standard input stream.
| intercept | Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false |
|
static |
Sets the foreground and background console colors to their defaults.
Sets the position of the cursor.
| left | The column position of the cursor. Columns are numbered from left to right starting at 0. |
| top | The row position of the cursor. Rows are numbered from top to bottom starting at 0. |
| xtd::argument_out_of_range_exception | The left in a set operation is less than zero -or- The left in a set operation is greater than or equal to xtd::console::buffer_width -or- the top in a set operation is less than zero -or- The topo in a set operation is greater than or equal to xtd::console::buffer_height. |
|
static |
Sets the error property to the specified std::ostream object.
| os | A stream that is the new standard error output. |
|
static |
Sets the int property to the specified std::istream object.
| os | A stream that is the new standard input. |
|
static |
Sets the out property to the specified std::ostream object.
| os | A stream that is the new standard output. |
Sets the position of the console window relative to the screen buffer.
| left | The column position of the upper left corner of the console window. |
| top | The row position of the upper left corner of the console window. |
| xtd::argument_out_of_range_exception | The left in a set operation is less than zero -or- The left in a set operation is greater than or equal to xtd::console::buffer_width -or- the top in a set operation is less than zero -or- The topo in a set operation is greater than or equal to xtd::console::buffer_height. |
Sets the height and width of the console window to the specified values.
| width | The width of the console window measured in columns. |
| height | The height of the console window measured in rows. |
| xtd::argument_out_of_range_exception | width or height is less than or equal to zero. -or- width plus WindowLeft or height plus WindowTop is greater than or equal to xtd::int16_object.max_value. -or- width or height is greater than the largest possible window width or height for the current screen resolution and console font. |
|
static |
Gets the title to display in the console title bar.
|
static |
Sets the title to display in the console title bar.
| title | The string to be displayed in the title bar of the console. The maximum length of the title string is 24500 characters. |
|
static |
Gets a value indicating whether the combination of the Control modifier key and C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system.
|
static |
Sets a value indicating whether the combination of the Control modifier key and C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system.
| treat_control_c_as_input | true if Ctrl+C is treated as ordinary input; otherwise, false. |
|
static |
Gets the height of the console window area.
|
static |
Sets the height of the console window area.
| height | The height of the console window measured in rows. |
|
static |
Gets the left of the console window area.
|
static |
Sets the left of the console window area.
| left | The left of the console window measured in columns. |
|
static |
Gets the top of the console window area.
|
static |
Sets the top of the console window area.
| top | The top of the console window measured in rows. |
|
static |
Gets the width of the console window area.
|
static |
Sets the width of the console window area.
| width | The width of the console window measured in columns. |
|
inlinestatic |
Writes the text representation of the specified value to the standard output stream.
| arg_t | The type of the value to write. |
| value | The value to write, |
|
inlinestatic |
Writes the text representation of the specified list of values to the standard output stream using the specified format information.
| ...args_t | Types of the values to write. |
| values | Values to write, |
|
static |
Writes the current line terminator to the standard output stream using the specified format information.
|
inlinestatic |
Writes the text representation of the specified value, followed by the current line terminator, to the standard output stream.
| arg_t | The type of the value to write. |
| value | The value to write, |
|
inlinestatic |
Writes the text representation of the specified list of values, followed by the current line terminator, to the standard output stream using the specified format information.
| ...args_t | Types of the values to write. |
| values | Values to write, |
|
static |
Occurs when the Control modifier key (Ctrl) and either the ConsoleKey.C console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break).
|
static |
Gets the error output stream. A std::basic_ostream<char_t> that represents the error output stream.
|
static |
Gets the standard input stream. A std::basic_istream<char_t> that represents the standard input stream.
|
static |
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output stream.