Declarations
Public Only
namespace std
struct OsString {
var data_ : native_string_t
}
OsString: stores an OS-native string. Convert explicitly to/from UTF-8.
func make(str : native_string_t) : OsString
Construct from UTF-8. On POSIX this copies the bytes; on Windows this converts to UTF-16.
func empty(self : &OsString) : bool
func native(self : &OsString) : &native_string_t
Get access to the native underlying string/characters
func c_str_native(self : &OsString) : *native_char_t
Get a pointer to native data (null-terminated if you ensure it)
func reserve(self : &OsString, n : size_t) : void
func append_utf8(self : &OsString, data : *char, len : size_t) : void
TODO: support shrink_to_fit
Append a UTF-8 string
func append_native(self : &OsString, native : &native_string_t) : void
Append native data directly
Helper: convert UTF-8 -> std::u16string using Win32 API
Helper: convert std::u16string -> UTF-8 using Win32 API
func delete(self : *OsString) : void
OsString: stores an OS-native string. Convert explicitly to/from UTF-8.