api

os_string.ch

Declarations in os_string.ch

1 declarationsstd

Declarations

Public only
std#
Publicnamespace
namespace std
OsString#
struct
struct OsString { var data_ : native_string_t }
OsString: stores an OS-native string. Convert explicitly to/from UTF-8.
make#
PublicfunctionConstructor
func make(str : native_string_t) : OsString
make2#
PublicfunctionConstructor
func make2(utf8 : &string) : OsString
Construct from UTF-8. On POSIX this copies the bytes; on Windows this converts to UTF-16.
from_utf8#
Publicfunction
func from_utf8(utf8 : &string) : OsString
--- factory helpers ---
size#
Publicfunction
func size(self : &OsString) : size_t
--- accessors ---
empty#
Publicfunction
func empty(self : &OsString) : bool
native#
Publicfunction
func native(self : &OsString) : &native_string_t
Get access to the native underlying string/characters
c_str_native#
Publicfunction
func c_str_native(self : &OsString) : *native_char_t
Get a pointer to native data (null-terminated if you ensure it)
clear#
Publicfunction
func clear(self : &OsString) : void
--- modify ---
reserve#
Publicfunction
func reserve(self : &OsString, n : size_t) : void
append_utf8#
Publicfunction
func append_utf8(self : &OsString, data : *char, len : size_t) : void
TODO: support shrink_to_fit
append_utf8_str#
Publicfunction
func append_utf8_str(self : &OsString, utf8 : &string) : void
Append a UTF-8 string
append_utf8_view#
Publicfunction
func append_utf8_view(self : &OsString, utf8 : &string_view) : void
append_native#
Publicfunction
func append_native(self : &OsString, native : &native_string_t) : void
Append native data directly
to_utf8#
Publicfunction
func to_utf8(self : &OsString) : string
Swap
delete#
function
func delete(self : *OsString) : void
OsString: stores an OS-native string. Convert explicitly to/from UTF-8.