> home > Custom Layer Boundary API

buffer_read_range

January 19th 2020
Read a range of text out of a buffer

Signature

C++
b32
buffer_read_range(Application_Links* app,
                  Buffer_ID buffer_id,
                  Range_i64 range,
                  u8* out);

Parameters

app

the standard custom layer context pointer

buffer_id

the id of the buffer to be read

range

byte range in the buffer that will be read - the range is left inclusive right exclusive, for example the range [10,20) reads ten bytes, with the first byte read being the one with index 10.

out

the buffer that will get the copy of the new text which should have at least range.max - range.min available bytes

Return

non-zero on success, when the buffer exists and the range is completely contained within the buffer's contents, otherwise zero