Module: io.console
Source: ./io/console.reef
Overview
io/console - Console input/output operations
Provides functions for reading from stdin and writing to stdout/stderr
Functions
fn readLine(): option.Option[string]
Reads a line from standard input Returns Some(line) with trailing newline removed, or None if stdin is at EOF/closed. A blank line (user just pressed Enter) is Some("") -- distinct from None: fgets writes nothing and leaves the buffer empty on EOF, whereas a blank line still gets the "\n" written, so we distinguish the two by checking reef_feof() only when the buffer came back empty.
fn readLinePrompt(prompt: string): option.Option[string]
Reads a line with a prompt Returns Some(line) or None on EOF/stdin-closed -- see readLine().
fn reef_getch(): int
FFI declaration for the runtime helper
fn getchar_raw(): int
Read a single character without echo and without waiting for Enter Returns the character code as int (-1 on error)
fn getch(): char
Read a single character without echo, returns as char type
fn confirm(prompt: string): bool
Confirmation prompt with default Yes Accepts: Y, y, Enter -> true Accepts: N, n -> false Other keys: re-prompt
fn confirm_default_no(prompt: string): bool
Confirmation prompt with default No Accepts: Y, y -> true Accepts: N, n, Enter -> false
Procedures
proc flushOutput()
Flushes stdout buffer
proc printErr(message: string)
Prints to stderr
Generated by reefc doc