api
u16_string.ch
Declarations in u16_string.ch
1 declarationsstd
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
}
constructor2#
PublicfunctionConstructor
func constructor2(value : *u16, length : size_t, ensure : bool) : u16string
the ensure parameter is added just to differentiate signature from constructor above it
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
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
substring copy by u16 unit indices
to_utf8#
Publicfunction
convert from UTF-16 to UTF-8; returns newly allocated buffer and length
find#
Publicfunction
find substring (naive, by u16 code units). returns first index or -1