llstream

Low-level streams for high performance.

Imports

pathutils

Types

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

Procs

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 llStreamOpen(): PLLStream {...}{.raises: [], tags: [].}
Source Edit
proc llStreamOpenStdIn(r: TLLRepl = llReadFromStdin): PLLStream {...}{.raises: [],
    tags: [].}
Source Edit
proc llStreamClose(s: PLLStream) {...}{.raises: [], tags: [].}
Source Edit
proc endsWith(x: string; s: set[char]): bool {...}{.raises: [], tags: [].}
Source Edit
proc endsWithOpr(x: string): bool {...}{.raises: [], tags: [].}
Source Edit
proc llStreamRead(s: PLLStream; buf: pointer; bufLen: int): int {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
Source Edit
proc llStreamReadLine(s: PLLStream; line: var string): bool {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
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
proc llStreamWrite(s: PLLStream; data: char) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
Source Edit
proc llStreamWrite(s: PLLStream; buf: pointer; buflen: int) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
Source Edit
proc llStreamReadAll(s: PLLStream): string {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
Source Edit

© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/llstream.html