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 UTF16FromString(mut s: string): []u16
fn UTF16ToString(s: []u16): string
fn UTF16PtrToString(s: *u16): string
fn BytePtrToString(s: *byte): string
fn BytesFromString(s: string): []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.
UTF16FromString
fn UTF16FromString(mut s: string): []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.
UTF16ToString
fn UTF16ToString(s: []u16): stringReturns the UTF-8 encoding of the UTF-16 sequence s, with a terminating NULL removed. Returns empty string if s is nil.
UTF16PtrToString
fn UTF16PtrToString(s: *u16): stringReturns 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.
BytePtrToString
#disable boundary
fn BytePtrToString(s: *byte): stringReturns the string of s, with a terminating NULL removed. Returns empty string if pointer is nil.
BytesFromString
fn BytesFromString(s: string): []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.