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