textmatrix v0.2.0 Textmatrix.Line View Source

%Textmatrix.Line{} describes a single line in the Matrix. A line buffer consist of character slots which can either hold a single character or nil.

Link to this section Summary

Functions

ensure_capacity/2 resizes the given line buffer to the desired size. When the provider buffer is of sufficient size, it returns the given buffer as is.

new/0 initializes a new empty line struct

to_string/1 convert the given %Line{} struct to a single line string.

write_string/3 takes the line, a start position and a string and writes the characters of the given string to the given line buffer.

Link to this section Types

Link to this type

t()

View Source
t() :: %Textmatrix.Line{chars: [char()]}

Link to this section Functions

Link to this function

ensure_capacity(line, min_length)

View Source
ensure_capacity(t(), integer()) :: t()

ensure_capacity/2 resizes the given line buffer to the desired size. When the provider buffer is of sufficient size, it returns the given buffer as is.

new/0 initializes a new empty line struct

Link to this function

to_string(line, emptychar \\ 32)

View Source

to_string/1 convert the given %Line{} struct to a single line string.

Link to this function

write_string(line, x, string)

View Source
write_string(t(), integer(), binary()) :: t()

write_string/3 takes the line, a start position and a string and writes the characters of the given string to the given line buffer.