compiler/llstream

  Source   Edit

Low-level streams for high performance.

Types

OnPrompt = proc () {.closure.}
  Source   Edit
PLLStream = ref TLLStream
  Source   Edit
TLLRepl = proc (s: PLLStream; buf: pointer; bufLen: int): int
  Source   Edit
TLLStream = object of RootObj
  kind*: TLLStreamKind
  f*: File
  s*: string
  rd*, wr*: int
  lineOffset*: int
  repl*: TLLRepl
  onPrompt*: OnPrompt
  Source   Edit
TLLStreamKind = enum
  llsNone, llsString, llsFile, llsStdIn
  Source   Edit

Procs

proc endsWith(x: string; s: set[char]): bool {....raises: [], tags: [].}
  Source   Edit
proc endsWithOpr(x: string): bool {....raises: [], tags: [].}
  Source   Edit
proc llStreamClose(s: PLLStream) {....raises: [], tags: [].}
  Source   Edit
proc llStreamOpen(): PLLStream {....raises: [], tags: [].}
  Source   Edit
proc llStreamOpen(data: string): PLLStream {....raises: [], tags: [].}
  Source   Edit
proc llStreamOpen(f: File): PLLStream {....raises: [], tags: [].}
  Source   Edit
proc llStreamOpen(filename: AbsoluteFile; mode: FileMode): PLLStream {.
    ...raises: [], tags: [].}
  Source   Edit
proc llStreamOpenStdIn(r: TLLRepl = llReadFromStdin; onPrompt: OnPrompt = nil): PLLStream {.
    ...raises: [], tags: [].}
  Source   Edit
proc llStreamRead(s: PLLStream; buf: pointer; bufLen: int): int {.
    ...raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
  Source   Edit
proc llStreamReadAll(s: PLLStream): string {....raises: [IOError],
    tags: [ReadIOEffect].}
  Source   Edit
proc llStreamReadLine(s: PLLStream; line: var string): bool {....raises: [IOError],
    tags: [ReadIOEffect].}
  Source   Edit
proc llStreamWrite(s: PLLStream; buf: pointer; buflen: int) {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit
proc llStreamWrite(s: PLLStream; data: char) {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit
proc llStreamWrite(s: PLLStream; data: string) {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit
proc llStreamWriteln(s: PLLStream; data: string) {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit