widestrs
nimony/lib/std/widestrs.nim
Nim support for C/C++'s wide strings:idx:.
type Utf16Char = distinct int16type WideCString = ptr UncheckedArray[Utf16Char]type WideCStringObj = object bytes: int64 data: ptr UncheckedArray[Utf16Char]
template [](a: WideCStringObj; idx: int64): Utf16Chartemplate []=(a: WideCStringObj; idx: int64; val: Utf16Char)func toWideCString(x: WideCStringObj): ptr UncheckedArray[Utf16Char]func rawData(x: WideCStringObj): ptr UncheckedArray[Utf16Char]func len(w: ptr UncheckedArray[Utf16Char]): int64returns the length of a widestring. This traverses the whole string to find the binary zero end marker!
func newWideCString(size: int64): WideCStringObjfunc newWideCString(source: cstring; L: int64): WideCStringObjWarning::
sourceneeds to be preallocated with the lengthLfunc newWideCString(s: cstring): WideCStringObjfunc newWideCString(s: var string): WideCStringObjfunc $(w: ptr UncheckedArray[Utf16Char]; estimate: int64; replacement: int64): stringfunc $(s: ptr UncheckedArray[Utf16Char]): stringfunc $(s: WideCStringObj; estimate: int64; replacement: int64): stringfunc $(s: WideCStringObj): stringfunc len(w: WideCStringObj): int64