5#ifndef WPINET_UV_TTY_H_
6#define WPINET_UV_TTY_H_
25 struct private_init {};
28 explicit Tty(
const private_init&) {}
29 ~Tty() noexcept override = default;
51 return Create(*loop, fd, readable);
77 int width = 0, height = 0;
79 return std::make_pair(width, height);
void ReportError(int err) const
Report an error.
Definition: Handle.h:236
bool Invoke(F &&f, Args &&... args) const
Definition: Handle.h:251
Event loop.
Definition: Loop.h:37
uv_tty_t * GetRaw() const noexcept
Get the underlying handle data structure.
Definition: Stream.h:322
TTY handle.
Definition: Tty.h:24
~Tty() noexcept override=default
static std::shared_ptr< Tty > Create(Loop &loop, uv_file fd, bool readable)
Create a TTY handle.
Tty(const private_init &)
Definition: Tty.h:28
void SetMode(uv_tty_mode_t mode)
Set the TTY using the specified terminal mode.
Definition: Tty.h:59
void ResetMode()
Reset TTY settings to default values for the next process to take over.
Definition: Tty.h:70
std::pair< int, int > GetWindowSize()
Gets the current window size.
Definition: Tty.h:76
Definition: StdDeque.h:50
Definition: ParallelTcpConnector.h:22
uv_tty_mode_t
Definition: uv.h:734
UV_EXTERN int uv_tty_set_mode(uv_tty_t *, uv_tty_mode_t mode)
UV_EXTERN int uv_tty_reset_mode(void)
UV_EXTERN int uv_tty_get_winsize(uv_tty_t *, int *width, int *height)
int uv_file
Definition: win.h:239