u16_string.ch

Declarations

Public Only
std
Publicnamespace
namespace std
u16_strlen
Publicfunction
func u16_strlen(ptr : *u16) : size_t
u16string
Publicstruct
struct u16string { var storage : var state : char }
constructor
Publicfunction
func constructor(value : *u16, length : size_t) : u16string
constructor2
Publicfunction
func constructor2(value : *u16, length : size_t, ensure : bool) : u16string
the ensure parameter is added just to differentiate signature from constructor above it
empty_str
Publicfunction
func empty_str() : u16string
make_no_len
Publicfunction
func make_no_len(value : *u16) : u16string
size
Publicfunction
func size(self : &u16string) : size_t
empty
Publicfunction
func empty(self : &u16string) : bool
move_const_to_buffer
Publicfunction
func move_const_to_buffer(self : &u16string) : void
move_data_to_heap
Publicfunction
func move_data_to_heap(self : &u16string, from_data : *u16, length : size_t, capacity : size_t) : void
resize_heap
Publicfunction
func resize_heap(self : &u16string, new_capacity : size_t) : void
this is a private function
ensure_mut
Publicfunction
func ensure_mut(self : &u16string, length : size_t) : void
ensures that capacity is larger than length given and memory is mutable
reserve
Publicfunction
func reserve(self : &u16string, new_capacity : size_t) : void
set
Publicfunction
func set(self : &u16string, index : size_t, value : u16) : void
get
Publicfunction
func get(self : &u16string, index : size_t) : u16
append_with_len
Publicfunction
func append_with_len(self : &u16string, value : *u16, len : size_t) : void
append_u16_unit
Publicfunction
func append_u16_unit(self : &u16string, u : u16) : void
append a single u16 unit (caller provides correct unit)
append_char
Publicfunction
func append_char(self : &u16string, c : char) : void
append a single char (treated as a single UTF-8 byte)
append_codepoint
Publicfunction
func append_codepoint(self : &u16string, cp : u32) : void
append a Unicode code point (uint32), handling surrogate pairs
append_utf8_view
Publicfunction
func append_utf8_view(self : &u16string, ptr : *char, len : size_t) : void
append UTF-8 view: convert to UTF-16 and append
substr
Publicfunction
func substr(self : &u16string, start : size_t, len : size_t) : u16string
substring copy by u16 unit indices
to_utf8
Publicfunction
func to_utf8(self : &u16string) : string
convert from UTF-16 to UTF-8; returns newly allocated buffer and length
find
Publicfunction
func find(self : &u16string, sub : u16string) : int
find substring (naive, by u16 code units). returns first index or -1
starts_with
Publicfunction
func starts_with(self : &u16string, prefix : u16string) : bool
ends_with
Publicfunction
func ends_with(self : &u16string, suffix : u16string) : bool
push_back
Publicfunction
func push_back(self : &u16string, u : u16) : void
convenience push_back/pop_back
pop_back
Publicfunction
func pop_back(self : &u16string) : void
capacity
Publicfunction
func capacity(self : &u16string) : size_t
data
Publicfunction
func data(self : &u16string) : *u16
mutable_data
Publicfunction
func mutable_data(self : &u16string) : *u16
clear
Publicfunction
func clear(self : &u16string) : void
delete
Publicfunction
func delete(self : &u16string) : void