Text_Buffer module

buffer_to_string

procedureextensionexperimentalsince 0.31.0Source

The whole text as a new string, made with allocator. Free it unless the allocator is temporary.

Example↗
buffer: Text_Buffer;
defer free_buffer(*buffer);
set_text(*buffer, "abc");
insert(*buffer, 3, "def");
assert(buffer_to_string(*buffer, temp) == "abcdef");
buffer_to_string :: (
    buffer: *Text_Buffer,
    allocator: Allocator = context.allocator
) -> string

Parameters

buffer: *Text_Buffer
allocator: Allocator = context.allocator

Returns

string

See also