From 79a35574ce6d472f7a7cc4a200a1ed7befe34066 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 24 Sep 2026 07:59:43 +0200 Subject: doc: add API documentation --- ttwhy/terminal/readers.cppm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ttwhy/terminal/readers.cppm') diff --git a/ttwhy/terminal/readers.cppm b/ttwhy/terminal/readers.cppm index ffa5687..c59f30b 100644 --- a/ttwhy/terminal/readers.cppm +++ b/ttwhy/terminal/readers.cppm @@ -18,6 +18,18 @@ import ttwhy.core; namespace ttwhy::terminal { + //! Asynchronously read raw bytes from an input stream, decode terminal events, and dispatch them to a router. + //! + //! Reads chunks from the input stream, feeding them to a terminal scanner configured with the specified + //! policy. If a sequence is pending and no data arrives before the inter-byte timeout, triggers a timeout + //! resolution. Dispatches all resulting events to the provided router. + //! + //! @tparam TerminalPolicy The terminal escape decoding policy (defaults to xterm_policy). + //! @tparam InputStream The input stream type supporting asynchronous reads. + //! @tparam AppRouter The router type that processes terminal input events. + //! @param stream The input stream descriptor to read from. + //! @param router The application router to receive and process input events. + //! @return An awaitable task that runs until the stream ends or encounters an error. export template AppRouter> auto read_events(InputStream & stream, AppRouter & router) -> asio::awaitable { -- cgit v1.2.3