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