blob: 79252850531b897c553f608494dbcf10e31dbb2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
signature STREAM = sig
type fileId = int
type fileOffset = int
datatype pos = Pos of string * int * int
type t
exception EOF
val pos2str: pos -> string
val getchar: t -> char option * t
val getcharEx: t -> char * t (* throws EOF *)
(* Will throw UngetcError, if applied at the beginning of the stream.
* Can be always avoided, so is not provided in sig file *)
val ungetc: t -> t
val EOFpos: t -> pos * t
val getSubstr: fileOffset -> fileOffset -> t -> string
val getFname: t -> string
(* both throw IO.Io *)
val create: string -> t
val createFromInstream: string -> TextIO.instream -> t
val getOffset: t -> fileOffset
val getPosRaw: fileOffset -> t -> pos * t
val getPos: t -> pos * t
val getPosAfterChar: t -> pos * t
end
|