system/widestrs

  Source   Edit

Types

Utf16Char = distinct int16
  Source   Edit
WideCStringObj = object
  data: seq[Utf16Char]       ## the raw character buffer. The number of elements
                             ## doesn't necessarily correspond to the length of
                             ## the string
  
  Source   Edit

Procs

proc `$`(s: WideCString): string {....raises: [], tags: [].}
  Source   Edit
proc `$`(s: WideCStringObj): string {....raises: [], tags: [].}
  Source   Edit
proc `$`(s: WideCStringObj; estimate: int; replacement: int = 0x0000FFFD): string {.
    ...raises: [], tags: [].}
  Source   Edit
proc `$`(w: WideCString; estimate: int; replacement: int = 0x0000FFFD): string {.
    ...raises: [], tags: [].}
  Source   Edit
proc len(w: WideCString): int {....raises: [], tags: [].}
returns the length of a widestring. This traverses the whole string to find the binary zero end marker!   Source   Edit
proc newWideCString(s: cstring): WideCStringObj {....raises: [], tags: [].}
Returns a copy of the string s in wide form. s should be NUL-terminated.   Source   Edit
proc newWideCString(s: string): WideCStringObj {....raises: [], tags: [].}
Returns a copy of the string s in wide form.   Source   Edit
proc newWideCString(size: int): WideCStringObj {....raises: [], tags: [].}
Create an empty WideCStringObj with the given buffer size in UTF-16 code units.   Source   Edit
proc newWideCString(source: cstring; L: int): WideCStringObj {....raises: [],
    tags: [].}
Take a cstring and its length L in bytes, then returns a copy in wide form.   Source   Edit

Converters

converter toWideCString(x: WideCStringObj): WideCString {.inline, ...raises: [],
    tags: [].}
  Source   Edit

Templates

template `[]=`(a: WideCStringObj; idx: int; val: Utf16Char)
  Source   Edit
template `[]`(a: WideCStringObj; idx: int): Utf16Char
  Source   Edit