Batteries user guide : Extlib.IO

`sig
type input = BatInnerIO.input
type 'a output = 'a BatInnerIO.output
type ('a, 'b) printer = 'b output -> 'a -> unit
type 'a f_printer = Format.formatter -> 'a -> unit
exception No_more_input
exception Input_closed
exception Output_closed
val stdin : input
val stdout : unit output
val stderr : unit output
val stdnull : unit output
val read : input -> char
val nread : input -> int -> string
val really_nread : input -> int -> string
val input : input -> string -> int -> int -> int
val really_input : input -> string -> int -> int -> int
val close_in : input -> unit
val write : (char, 'a) printer
val nwrite : (string, 'a) printer
val output : 'a output -> string -> int -> int -> int
val really_output : 'a output -> string -> int -> int -> int
val flush : 'a output -> unit
val flush_all : unit -> unit
val close_out : 'a output -> 'a
val close_all : unit -> unit
val input_string : string -> input
val output_string : unit -> string output
val input_enum : char BatEnum.t -> input
val output_enum : unit -> char BatEnum.t output
val combine : 'a output * 'b output -> ('a * 'b) output
val tab_out : ?tab:char -> int -> 'a output -> unit output
val read_all : input -> string
val pipe : unit -> input * unit output
val copy : ?buffer:int -> input -> 'a output -> unit
val pos_in : input -> input * (unit -> int)
val progress_in : input -> (unit -> unit) -> input
val pos_out : 'a output -> unit output * (unit -> int)
val progress_out : 'a output -> (unit -> unit) -> unit output
external cast_output : 'a output -> unit output = "%identity"
exception Overflow of string
val read_byte : input -> int
val read_signed_byte : input -> int
val read_ui16 : input -> int
val read_i16 : input -> int
val read_i32 : input -> int
val read_real_i32 : input -> int32
val read_i64 : input -> int64
val read_float : input -> float
val read_double : input -> float
val read_string : input -> string
val read_line : input -> string
val write_byte : (int, 'a) printer
val write_ui16 : (int, 'a) printer
val write_i16 : (int, 'a) printer
val write_i32 : (int, 'a) printer
val write_real_i32 : (int32, 'a) printer
val write_i64 : (int64, 'a) printer
val write_double : (float, 'a) printer
val write_float : (float, 'a) printer
val write_string : (string, 'a) printer
val write_line : (string, 'a) printer
module BigEndian :
sig
val read_ui16 : input -> int
val read_i16 : input -> int
val read_i32 : input -> int
val read_real_i32 : input -> int32
val read_i64 : input -> int64
val read_double : input -> float
val read_float : input -> float
val write_ui16 : (int, 'a) printer
val write_i16 : (int, 'a) printer
val write_i32 : (int, 'a) printer
val write_real_i32 : (int32, 'a) printer
val write_i64 : (int64, 'a) printer
val write_double : (float, 'a) printer
val write_float : (float, 'a) printer
val ui16s_of : input -> int BatEnum.t
val i16s_of : input -> int BatEnum.t
val i32s_of : input -> int BatEnum.t
val real_i32s_of : input -> int32 BatEnum.t
val i64s_of : input -> int64 BatEnum.t
val doubles_of : input -> float BatEnum.t
val floats_of : input -> float BatEnum.t
end
type in_bits = BatIO.in_bits
type out_bits = BatIO.out_bits
exception Bits_error
val input_bits : input -> in_bits
val output_bits : 'a output -> out_bits
val read_bits : in_bits -> int -> int
val write_bits : out_bits -> nbits:int -> int -> unit
val flush_bits : out_bits -> unit
val drop_bits : in_bits -> unit
val create_in :
read:(unit -> char) ->
input:(string -> int -> int -> int) -> close:(unit -> unit) -> input
val wrap_in :
read:(unit -> char) ->
input:(string -> int -> int -> int) ->
close:(unit -> unit) -> underlying:input list -> input
val inherit_in :
?read:(unit -> char) ->
?input:(string -> int -> int -> int) ->
?close:(unit -> unit) -> input -> input
val create_out :
write:(char -> unit) ->
output:(string -> int -> int -> int) ->
flush:(unit -> unit) -> close:(unit -> 'a) -> 'a output
val wrap_out :
write:(char -> unit) ->
output:(string -> int -> int -> int) ->
flush:(unit -> unit) ->
close:(unit -> 'a) -> underlying:'b output list -> 'a output
val inherit_out :
?write:(char -> unit) ->
?output:(string -> int -> int -> int) ->
?flush:(unit -> unit) ->
?close:(unit -> unit) -> 'a output -> unit output
val input_channel : ?autoclose:bool -> ?cleanup:bool -> in_channel -> input
val output_channel : ?cleanup:bool -> out_channel -> unit output
val to_input_channel : input -> in_channel
class in_channel :
input ->
object
method close_in : unit -> unit
method input : string -> int -> int -> int
end
class out_channel :
'a output ->
object
method close_out : unit -> unit
method flush : unit -> unit
method output : string -> int -> int -> int
end
class in_chars :
input ->
object method close_in : unit -> unit method get : unit -> char end
class out_chars :
'a output ->
object
method close_out : unit -> unit
method flush : unit -> unit
method put : char -> unit
end
val from_in_channel : #in_channel -> input
val from_out_channel : #out_channel -> unit output
val from_in_chars : #in_chars -> input
val from_out_chars : #out_chars -> unit output
val bytes_of : input -> int BatEnum.t
val signed_bytes_of : input -> int BatEnum.t
val ui16s_of : input -> int BatEnum.t
val i16s_of : input -> int BatEnum.t
val i32s_of : input -> int BatEnum.t
val real_i32s_of : input -> int32 BatEnum.t
val i64s_of : input -> int64 BatEnum.t
val doubles_of : input -> float BatEnum.t
val floats_of : input -> float BatEnum.t
val strings_of : input -> string BatEnum.t
val lines_of : input -> string BatEnum.t
val lines_of2 : input -> string BatEnum.t
val chunks_of : int -> input -> string BatEnum.t
val chars_of : input -> char BatEnum.t
val bits_of : in_bits -> int BatEnum.t
val write_bitss : nbits:int -> out_bits -> int BatEnum.t -> unit
val default_buffer_size : int
val synchronize_in : ?lock:BatConcurrent.lock -> input -> input
val synchronize_out : ?lock:BatConcurrent.lock -> 'a output -> unit output
val lock : BatConcurrent.lock ref
val lock_factory : (unit -> BatConcurrent.lock) ref
val to_string : ('a, string) printer -> 'a -> string
val to_f_printer : ('a, 'b) printer -> 'a f_printer
val comb : 'a output * 'a output -> 'a output
val make_enum : (input -> 'a) -> input -> 'a BatEnum.t
val get_output_id : 'a output -> int
val get_input_id : input -> int
module Incubator :
sig
module Array :
sig
val pp :
?flush:bool ->
?first:string ->
?last:string ->
?sep:string ->
?indent:int ->
(Format.formatter -> 'a -> 'b) ->
Format.formatter -> 'a array -> unit
end
module Enum :
sig
val pp :
?flush:bool ->
?first:string ->
?last:string ->
?sep:string ->
?indent:int ->
(Format.formatter -> 'a -> 'b) ->
Format.formatter -> 'a BatEnum.t -> unit
end
module List :
sig
val pp :
?flush:bool ->
?first:string ->
?last:string ->
?sep:string ->
?indent:int ->
(Format.formatter -> 'a -> 'b) ->
Format.formatter -> 'a list -> unit
end
end
end`