Raxol.Terminal.OutputBuffer (Raxol v2.0.1)

View Source

Simple output buffer implementation for terminal output.

Summary

Functions

Clears the output buffer.

Checks if the output buffer is empty.

Flushes the output buffer.

Gets the current output buffer content.

Gets the current output buffer encoding.

Gets the current output buffer mode.

Gets the output buffer size.

Sets the output buffer content.

Sets the output buffer encoding.

Sets the output buffer mode.

Writes a string to the output buffer.

Writes a string to the output buffer with a newline.

Types

t()

@type t() :: String.t()

Functions

clear(buffer)

@spec clear(t()) :: t()

Clears the output buffer.

empty?(buffer)

@spec empty?(t()) :: boolean()

Checks if the output buffer is empty.

flush(buffer)

@spec flush(t()) :: {:ok, t()}

Flushes the output buffer.

get_content(buffer)

@spec get_content(t()) :: String.t()

Gets the current output buffer content.

get_encoding(buffer)

@spec get_encoding(t()) :: String.t()

Gets the current output buffer encoding.

get_mode(buffer)

@spec get_mode(t()) :: atom()

Gets the current output buffer mode.

get_size(buffer)

@spec get_size(t()) :: non_neg_integer()

Gets the output buffer size.

set_content(buffer, content)

@spec set_content(t(), String.t()) :: t()

Sets the output buffer content.

set_encoding(buffer, encoding)

@spec set_encoding(t(), String.t()) :: t()

Sets the output buffer encoding.

set_mode(buffer, mode)

@spec set_mode(t(), atom()) :: t()

Sets the output buffer mode.

write(buffer, string)

@spec write(t(), String.t()) :: t()

Writes a string to the output buffer.

writeln(buffer, string)

@spec writeln(t(), String.t()) :: t()

Writes a string to the output buffer with a newline.