| Standard ML Basis Library |
structure StreamIO =
struct
type vector = V.vector
type elem = V.elem
type reader = PIO.reader
type writer = PIO.writer
type pos = PIO.pos
datatype instream = ISTRM of in_buffer * int
datatype in_buffer =
IBUF of
{basePos : pos option, more : more ref, data : vector, info : info}
datatype more = MORE of in_buffer | EOS of in_buffer | NOMORE | TERMINATED
datatype info =
INFO of
{
reader : reader,
readVec : int -> vector,
readVecNB : (int -> vector) option,
closed : bool ref,
getPos : unit -> pos option,
tail : more ref ref,
cleanTag : CleanIO.tag
}
datatype outstream =
OSTRM of
{
buf : A.array,
pos : int ref,
closed : bool ref,
bufferMode : IO.buffer_mode ref,
writer : writer,
writeArr : {buf : A.array, i : int, sz : int option} -> unit,
writeVec : {buf : V.vector, i : int, sz : int option} -> unit,
cleanTag : CleanIO.tag
}
datatype out_pos = OUTP of {pos : PIO.pos, strm : outstream}
exception WouldBlock
val infoOfIBuf
val chunkSzOfIBuf
val readVec
val inputExn
val extendStream
val getBuffer
val readChunk
val generalizedInput
val terminate
val input : instream -> vector * instream
val input1 : instream -> (elem * instream) option
val inputN : instream * int -> vector * instream
val inputAll : instream -> vector * instream
val canInput : instream * int -> int option
val closeIn : instream -> unit
val endOfStream : instream -> bool
val mkInstream : reader * vector -> instream
val getReader : instream -> reader * vector
val filePosIn : instream -> pos
val inputLine : instream -> string * instream
val outputExn
val isNL
val isClosedOut
val flushBuffer
val lineBufCopyVec
val blockBufCopyVec
val output : outstream * vector -> unit
val output1 : outstream * elem -> unit
val flushOut : outstream -> unit
val closeOut : outstream -> unit
val mkOutstream : writer * IO.buffer_mode -> outstream
val getWriter : outstream -> writer * IO.buffer_mode
val getPosOut : outstream -> out_pos
val filePosOut : out_pos -> pos
val setPosOut : out_pos -> unit
val outputSubstr : outstream * substring -> unit
val setBufferMode : outstream * IO.buffer_mode -> unit
val getBufferMode : outstream -> IO.buffer_mode
end
Type detail |
---|
type vector = V.vector
type elem = V.elem
type reader = PIO.reader
type writer = PIO.writer
type pos = PIO.pos
Datatype detail |
---|
datatype instream = ISTRM of in_buffer * int
datatype in_buffer =
IBUF of
{basePos : pos option, more : more ref, data : vector, info : info}
datatype more = MORE of in_buffer | EOS of in_buffer | NOMORE | TERMINATED
datatype info =
INFO of
{
reader : reader,
readVec : int -> vector,
readVecNB : (int -> vector) option,
closed : bool ref,
getPos : unit -> pos option,
tail : more ref ref,
cleanTag : CleanIO.tag
}
datatype outstream =
OSTRM of
{
buf : A.array,
pos : int ref,
closed : bool ref,
bufferMode : IO.buffer_mode ref,
writer : writer,
writeArr : {buf : A.array, i : int, sz : int option} -> unit,
writeVec : {buf : V.vector, i : int, sz : int option} -> unit,
cleanTag : CleanIO.tag
}
datatype out_pos = OUTP of {pos : PIO.pos, strm : outstream}
DataConstructor detail |
---|
constructor ISTRM : in_buffer * int -> instream
constructor IBUF
: {
basePos : pos option,
more : more ref,
data : vector,
info : info
} ->
in_buffer
constructor MORE : in_buffer -> more
constructor EOS : in_buffer -> more
constructor NOMORE : more
constructor TERMINATED : more
constructor INFO
: {
reader : reader,
readVec : int -> vector,
readVecNB : (int -> vector) option,
closed : bool ref,
getPos : unit -> pos option,
tail : more ref ref,
cleanTag : CleanIO.tag
} ->
info
constructor OSTRM
: {
buf : A.array,
pos : int ref,
closed : bool ref,
bufferMode : IO.buffer_mode ref,
writer : writer,
writeArr : {buf : A.array, i : int, sz : int option} -> unit,
writeVec : {buf : V.vector, i : int, sz : int option} -> unit,
cleanTag : CleanIO.tag
} ->
outstream
constructor OUTP : {pos : PIO.pos, strm : outstream} -> out_pos
Value detail |
---|
val infoOfIBuf
val chunkSzOfIBuf
val readVec
val inputExn
val extendStream
val getBuffer
val readChunk
val generalizedInput
val terminate
val input : instream -> vector * instream
val input1 : instream -> (elem * instream) option
val inputN : instream * int -> vector * instream
val inputAll : instream -> vector * instream
val canInput : instream * int -> int option
val closeIn : instream -> unit
val endOfStream : instream -> bool
val mkInstream : reader * vector -> instream
val getReader : instream -> reader * vector
val filePosIn : instream -> pos
val inputLine : instream -> string * instream
val outputExn
val isNL
val isClosedOut
val flushBuffer
val lineBufCopyVec
val blockBufCopyVec
val output : outstream * vector -> unit
val output1 : outstream * elem -> unit
val flushOut : outstream -> unit
val closeOut : outstream -> unit
val mkOutstream : writer * IO.buffer_mode -> outstream
val getWriter : outstream -> writer * IO.buffer_mode
val getPosOut : outstream -> out_pos
val filePosOut : out_pos -> pos
val setPosOut : out_pos -> unit
val outputSubstr : outstream * substring -> unit
val setBufferMode : outstream * IO.buffer_mode -> unit
val getBufferMode : outstream -> IO.buffer_mode
Exception detail |
---|
exception WouldBlock
| Standard ML Basis Library |
This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.
Copyright © 2003 AT&T and Lucent Technologies. All rights reserved.
Permission is granted for internet users to make one paper copy for their
own personal use. Further hardcopy reproduction is strictly prohibited.
Permission to distribute the HTML document electronically on any medium
other than the internet must be requested from the copyright holders by
contacting the editors.
Printed versions of the SML Basis Manual are available from Cambridge
University Press.
To order, please visit
www.cup.org (North America) or
www.cup.cam.ac.uk (outside North America). |