abla/io

Generated from source.

Import with import "abla/io".

Source: abla/io/entry.ab

fun print(text: string): void

Portable console surface. Platform profiles provide the host declarations above; application code uses these functions and never names that adapter. Writes text to standard output without adding a newline. Write failures are not reported.

println (fun)

fun println(text: string = ""): void

Writes text and a newline to standard output. The default writes just a newline. Write failures are not reported.

eprint (fun)

fun eprint(text: string): void

Writes text to standard error without adding a newline. Write failures are not reported.

eprintln (fun)

fun eprintln(text: string = ""): void

Writes text and a newline to standard error. The default writes just a newline. Write failures are not reported.

InputLine (class)

class InputLine(
    val text: string,
    val available: bool
)

A line read from standard input. text holds its bytes and available records whether any input was consumed, including an empty line's terminator.

readInputLine (fun)

fun readInputLine(): InputLine

Reads through the next LF on standard input and discards all CR bytes. A partial final line is available. EOF and read errors both stop the read. With no input consumed, returns an empty string and available = false.

readLine (fun)

fun readLine(): string

Reads the next standard-input line using readInputLine. Returns an empty string for an empty line or when EOF or a read error occurs before any input.

BufferedTextWriter (class)

class BufferedTextWriter(
    val sink: (string) -> bool,
    val capacity: int,
    var chunks: array<string>,
    var bufferedBytes: int,
    var failed: bool
)

A portable buffered writer is parameterized by a normal Abla callback. It therefore works for console, files, sockets, tests, and future target adapters without embedding a platform handle in this module.

bufferedTextWriter (fun)

fun bufferedTextWriter(
    capacity: int,
    sink: (string) -> bool,
    initiallyFailed: bool = false
): BufferedTextWriter

Creates an empty writer that calls sink when flushed. capacity is the automatic flush threshold in bytes, with 4096 used for nonpositive values. Set initiallyFailed to disable writes and flushes. A sink returning false permanently marks the writer failed.

BufferedTextWriter.pendingBytes (extension fun)

fun BufferedTextWriter.pendingBytes(): int

Returns the number of buffered bytes, including bytes retained after a failed flush.

BufferedTextWriter.isHealthy (extension fun)

fun BufferedTextWriter.isHealthy(): bool

Returns true until the writer starts or becomes failed.

BufferedTextWriter.flush (extension fun)

fun BufferedTextWriter.flush(): bool

Passes all pending bytes to the sink in order. Returns true for an empty healthy buffer or a successful write. A false sink result retains the pending bytes, marks the writer failed, and returns false. A failed writer never calls the sink again.

BufferedTextWriter.write (extension fun)

fun BufferedTextWriter.write(text: string): bool

Buffers text and flushes once pending bytes reach the capacity. Returns true if the writer remains healthy, or false if it was already failed or its sink rejected the flush.

BufferedTextWriter.writeLine (extension fun)

fun BufferedTextWriter.writeLine(text: string = ""): bool

Buffers text followed by a newline, flushing at capacity. Returns false on an existing or newly reported sink failure.

bufferedStandardOutput (fun)

fun bufferedStandardOutput(capacity: int = 4096): BufferedTextWriter

Creates a writer for standard output with a flush threshold of capacity bytes. Nonpositive values use 4096. Write errors are reported by the writer when it flushes.

bufferedStandardError (fun)

fun bufferedStandardError(capacity: int = 4096): BufferedTextWriter

Creates a writer for standard error with a flush threshold of capacity bytes. Nonpositive values use 4096. Write errors are reported by the writer when it flushes.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.