Source Edit

Nim support for C/C++’s wide strings.

Types

  1. Utf16Char = distinct int16

Source Edit

  1. WideCString = ref UncheckedArray[Utf16Char]

Source Edit

  1. WideCStringObj = WideCString

Source Edit

Procs

  1. proc `$`(s: WideCString): string {....raises: [], tags: [], forbids: [].}

Source Edit

  1. proc `$`(w: WideCString; estimate: int; replacement: int = 0x0000FFFD): string {.
  2. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc len(w: WideCString): int {....raises: [], tags: [], forbids: [].}

returns the length of a widestring. This traverses the whole string to find the binary zero end marker! Source Edit

  1. proc newWideCString(s: cstring): WideCStringObj {....raises: [], tags: [],
  2. forbids: [].}

Source Edit

  1. proc newWideCString(s: string): WideCStringObj {....raises: [], tags: [],
  2. forbids: [].}

Source Edit

  1. proc newWideCString(size: int): WideCStringObj {....raises: [], tags: [],
  2. forbids: [].}

Source Edit

  1. proc newWideCString(source: cstring; L: int): WideCStringObj {....raises: [],
  2. tags: [], forbids: [].}

Source Edit