StringPool :: struct {
arena: Arena;
}
StringPool.add :: (sp: &StringPool, s: [] u8) -> [] u8
StringPool.flush :: (sp: &StringPool) -> void
StringPool.free :: (sp: &StringPool) -> void
String_Buffer :: struct {
data: [&] u8;
count: u32;
capacity: u32;
}
as_str :: (s: [&] u8) -> [] u8
as_str :: (bs: &BufferStream) -> [] u8
as_str :: macro (t: $T) -> str
where HasAsStrMethod(T)
Generic procedure for turning something into a string.
buffer_append :: (buffer: &String_Buffer, end: [] u8) -> bool
buffer_clear :: (buffer: &String_Buffer) -> void
buffer_delete :: (buffer: &String_Buffer, position: i32) -> bool
buffer_insert :: (buffer: &String_Buffer, position: i32, ch: u8) -> bool
buffer_make :: (buffer_memory: [] u8, initial_str: [] u8) -> String_Buffer
buffer_to_str :: (buffer: &String_Buffer) -> [] u8
compare :: (str1: [] u8, str2: [] u8) -> i32
from_cstr :: (s: [&] u8) -> [] u8
is_empty :: (s: [] u8) -> bool
join :: (strs: [] [] u8, sep: [] u8, allocator: Allocator) -> [] u8
length :: (s: [] u8) -> u32
length :: (s: [&] u8) -> u32
pool_add :: (sp: &StringPool, s: [] u8) -> [] u8
pool_flush :: (sp: &StringPool) -> void
pool_free :: (sp: &StringPool) -> void
pool_make :: (maximum_string_length: i32, allocator: Allocator) -> StringPool
to_cstr_on_stack :: macro (s_: [] u8) -> [&] u8
Converts a str
into a cstr
by copying the memory of the string to the stack, with an additional byte at the end that is set to 0, to correctly for a C-string.
This only needs to be done when the string does not contain a 0
byte on the end, which is most of the time. If you know that the string has a 0
byte, simply use s.data
.