BufferedIO.readLine

Read a single line

Reads a single line from the buffered IO. The line must fit the struct's allocated read buffer.

  1. const(char)[] readLine(char terminator)
    struct BufferedIO(T)
    @trusted @nogc
    const(char)[]
    readLine
    (
    char terminator = '\n'
    )
  2. const(char)[] readLine(char terminator, bool partialOk, ARGS args)

Parameters

terminator char

the line terminator to look for.

Return Value

Type: const(char)[]

The function returns a const(char)[] that points to the file's read buffer. This means that no copy is done (the data is read directly to its final resting place), but it also means that the data might disappear if further read operations are done on the file.

Upon successful read, the returned range contains the terminating character as its last element. See Notes below for discussion on partial lines.

In case of end of file, the function returns a slice of length 0.

Meta