Lyricdev
GitHub

class Stdin

pub class Stdin :: [Reader]

Conforms to Reader.

The standard input (stdin()): a Reader, and its text a line at a time.

Methods

pub mut fn readLine(): ?string throws IoError

Reads the next line without its end — a \n or a \r\n —; returns null at the end of the input.

Errors

Throws IoError where the read fails, or InvalidData for bytes that are no UTF-8.

pub fn lines(): StdinLinesIter

Returns the lines to the end of the input, as readLine gives them.

pub mut fn read(into: Slice<uint8>): int throws IoError

Reads bytes into into — what a line's read left in the buffer first — and returns how many; 0 only at the end.

Errors

Throws IoError where the read fails.