aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/terminal/readers.cppm
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-09-24 07:59:43 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-09-24 07:59:43 +0200
commit79a35574ce6d472f7a7cc4a200a1ed7befe34066 (patch)
tree1fb3c1c33645692bc041af8d285bb99754887149 /ttwhy/terminal/readers.cppm
parentd05b9343f69a0841043963088e0003368e205bd9 (diff)
downloadttwhy-79a35574ce6d472f7a7cc4a200a1ed7befe34066.tar.xz
ttwhy-79a35574ce6d472f7a7cc4a200a1ed7befe34066.zip
doc: add API documentation
Diffstat (limited to 'ttwhy/terminal/readers.cppm')
-rw-r--r--ttwhy/terminal/readers.cppm12
1 files changed, 12 insertions, 0 deletions
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<typename TerminalPolicy = xterm_policy, typename InputStream, ttwhy::router<input_event> AppRouter>
auto read_events(InputStream & stream, AppRouter & router) -> asio::awaitable<void>
{