std/integ
Supplementer package for Integrated Jule. Provides helper API to make interoperability easy and defines standards for common operations.
Index
fn AnyToUnsafeptr(x: any): *unsafe
fn UTF16FromStr(mut s: str): []u16
fn UTF16ToStr(s: []u16): str
fn UTF16PtrToStr(s: *u16): str
fn BytePtrToStr(s: *byte): str
fn BytesFromStr(s: str): []byte
AnyToUnsafeptr
fn AnyToUnsafeptr(x: any): *unsafeReturns unsafe pointer to the allocation of the type any. It may be handled like C's voidptr type. It does not ensure safety of the allocation, so x may be deallocated while memory pointer is still alive. Make sure the allocation will not be deallocated until unsafe pointer being unreachable, otherwise any memory access may lead SEGFAULT.
UTF16FromStr
fn UTF16FromStr(mut s: str): []u16Returns the UTF-16 encoding of the UTF-8 string s, with a terminating NULL added. If s includes NULL character at any location, ignores followed characters.
UTF16ToStr
fn UTF16ToStr(s: []u16): strReturns the UTF-8 encoding of the UTF-16 sequence s, with a terminating NULL removed. Returns empty string if s is nil.
UTF16PtrToStr
fn UTF16PtrToStr(s: *u16): strReturns the UTF-8 encoding of the UTF-16 sequence s in *u16 form, with a terminating NULL removed. Returns empty string if s is nil.
BytePtrToStr
#disable boundary
fn BytePtrToStr(s: *byte): strReturns the string of s, with a terminating NULL removed. Returns empty string if pointer is nil.
BytesFromStr
fn BytesFromStr(s: str): []byteReturns s as NULL terminated byte slice which is able to be used safely as NULL terminated string pointer. If s contains NULL termination at any location, accepts NULL termination is the end of s and skips following bytes.