|
uvw 3.1.0
|
The tty handle. More...
#include <tty.h>


Public Member Functions | |
| int | init () final |
| Initializes the handle. | |
| bool | mode (tty_mode m) |
| Sets the TTY using the specified terminal mode. | |
| bool | reset_mode () noexcept |
| Resets TTY settings to default values. | |
| win_size | get_win_size () |
| Gets the current Window size. | |
| void | vterm_state (tty_vtermstate s) const noexcept |
| Controls whether console virtual terminal sequences are processed by the library or console. | |
| tty_vtermstate | vterm_state () const noexcept |
| Gets the current state of whether console virtual terminal sequences are handled by the library or the console. | |
Public Member Functions inherited from uvw::stream_handle< tty_handle, uv_tty_t > | |
| int | shutdown () |
| Shutdowns the outgoing (write) side of a duplex stream. | |
| int | listen (int backlog=DEFAULT_BACKLOG) |
| Starts listening for incoming connections. | |
| int | accept (S &ref) |
| Accepts incoming connections. | |
| int | read () |
| Starts reading data from an incoming stream. | |
| int | stop () |
| Stops reading data from the stream. | |
| int | write (std::unique_ptr< char[], Deleter > data, unsigned int len) |
| Writes data to the stream. | |
| int | write (char *data, unsigned int len) |
| Writes data to the stream. | |
| int | write (S &send, std::unique_ptr< char[], Deleter > data, unsigned int len) |
| Extended write function for sending handles over a pipe handle. | |
| int | write (S &send, char *data, unsigned int len) |
| Extended write function for sending handles over a pipe handle. | |
| int | try_write (std::unique_ptr< char[]> data, unsigned int len) |
| Queues a write request if it can be completed immediately. | |
| int | try_write (std::unique_ptr< char[]> data, unsigned int len, stream_handle< V, W > &send) |
| Queues a write request if it can be completed immediately. | |
| int | try_write (char *data, unsigned int len) |
| Queues a write request if it can be completed immediately. | |
| int | try_write (char *data, unsigned int len, stream_handle< V, W > &send) |
| Queues a write request if it can be completed immediately. | |
| bool | readable () const noexcept |
| Checks if the stream is readable. | |
| bool | writable () const noexcept |
| Checks if the stream is writable. | |
| bool | blocking (bool enable=false) |
| Enables or disables blocking mode for a stream. | |
| size_t | write_queue_size () const noexcept |
| Gets the amount of queued bytes waiting to be sent. | |
Public Member Functions inherited from uvw::handle< T, U, E > | |
| handle_category | category () const noexcept |
| Gets the category of the handle. | |
| handle_type | type () const noexcept |
| Gets the type of the handle. | |
| bool | active () const noexcept |
| Checks if the handle is active. | |
| bool | closing () const noexcept |
| Checks if a handle is closing or closed. | |
| void | close () noexcept |
| Request handle to be closed. | |
| void | reference () noexcept |
| Reference the given handle. | |
| void | unreference () noexcept |
| Unreference the given handle. | |
| bool | referenced () const noexcept |
| Checks if the given handle referenced. | |
| std::size_t | size () const noexcept |
| Returns the size of the underlying handle type. | |
| int | send_buffer_size () |
| Gets the size of the send buffer used for the socket. | |
| int | send_buffer_size (int value) |
| Sets the size of the send buffer used for the socket. | |
| int | recv_buffer_size () |
| Gets the size of the receive buffer used for the socket. | |
| int | recv_buffer_size (int value) |
| Sets the size of the receive buffer used for the socket. | |
| os_file_descriptor | fd () const |
| Gets the platform dependent file descriptor equivalent. | |
Public Member Functions inherited from uvw::resource< T, U, close_event, E... > | |
| std::shared_ptr< R > | data () const |
Gets user-defined data. uvw won't use this field in any case. | |
| void | data (std::shared_ptr< void > udata) |
Sets arbitrary data. uvw won't use this field in any case. | |
Public Member Functions inherited from uvw::uv_type< U > | |
| virtual int | init () |
| Initializes the handle. | |
| loop & | parent () const noexcept |
| Gets the loop from which the resource was originated. | |
| const U * | raw () const noexcept |
| Gets the underlying raw data structure. | |
| U * | raw () noexcept |
| Gets the underlying raw data structure. | |
Public Member Functions inherited from uvw::emitter< T, E... > | |
| void | on (listener_t< U > f) |
| Registers a long-lived listener with the event emitter. | |
| void | reset () noexcept |
| Disconnects the listener for the given event type. | |
| void | reset () noexcept |
| Disconnects all listeners. | |
| bool | has () const noexcept |
| Checks if there is a listener registered for the specific event. | |
The tty handle.
TTY handles represent a stream for the console.
To create a tty_handle through a loop, arguments follow:
uvw::std_in or 0 for stdinuvw::std_out or 1 for stdoutuvw::std_err or 2 for stderrread() with this stream. Remember that stdin is readable, stdout is not.See the official documentation for further details.
| win_size uvw::tty_handle::get_win_size | ( | ) |
Gets the current Window size.
{-1, -1} in case of errors.
|
finalvirtual |
| bool uvw::tty_handle::mode | ( | tty_mode | m | ) |
Sets the TTY using the specified terminal mode.
Available modes are:
TTY::tty_mode::NORMALTTY::tty_mode::RAWTTY::tty_mode::IOSee the official documentation for further details.
| m | The mode to be set. |
|
noexcept |
Resets TTY settings to default values.
|
noexcept |
Gets the current state of whether console virtual terminal sequences are handled by the library or the console.
This function is not implemented on Unix.
Available states are:
TTY::tty_vtermstate::SUPPORTEDTTY::tty_vtermstate::UNSUPPORTEDSee the official documentation for further details.
|
noexcept |
Controls whether console virtual terminal sequences are processed by the library or console.
This function is only meaningful on Windows systems. On Unix it is silently ignored.
Available states are:
TTY::tty_vtermstate::SUPPORTEDTTY::tty_vtermstate::UNSUPPORTEDSee the official documentation for further details.
| s | The state to be set. |