Reads a character buffer line by line or in fixed‐length chunks.

Synopsis

Declared in <util/string.h>

class LineReader;

Member Functions

Name

Description

LineReader [constructor]

Construct a reader over str that limits lines to max_line_length bytes.

Consumed

Returns number of bytes already read from buffer

ReadLength

Returns string from current iterator position of specified length if possible and advances iterator on success. May exceed max_line_length but will not read past end of buffer.

ReadLine

Returns a string from current iterator position up to (but not including) next and advances iterator to the character following the on success. Will not return a line longer than max_line_length.

Remaining

Returns remaining size of bytes in buffer

Created with MrDocs