package iostream

  1. Overview
  2. Docs
Generic, composable IO input and output streams

Install

dune-project
 Dependency

Authors

Maintainers

Sources

iostream-0.2.1.tbz
sha256=09cd438f755d46bf10e986be0d3dd2ab243b1f5455c3c7410dcde8de521615a9
sha512=c5f4c251ba33386dd027d2cf340268d14fdbcd3119be6bac3586fd9ad1e9f90992ef12e8fd9fbf2442c6747560d84fd2461656ea639f818e53d0b08e82dd8e9a

doc/iostream/Iostream/Out/index.html

Module Iostream.OutSource

Output stream.

Sourceclass type t = object ... end

An output stream, ie. a place into which we can write bytes. This can be a Buffer.t, an out_channel, a Unix.file_descr, etc.

Sourceclass type t_seekable = object ... end
Sourceclass dummy : t
Sourceval dummy : t

Dummy output, drops everything written to it.

Sourceclass of_out_channel : ?close_noerr:bool -> out_channel -> t_seekable
Sourceval of_out_channel : ?close_noerr:bool -> out_channel -> t_seekable

Wrap an out channel.

Sourceval of_buffer : Buffer.t -> t

of_buffer buf is an output channel that writes directly into buf. flush and close have no effect.

Sourceval open_file : ?close_noerr:bool -> ?mode:int -> ?flags:open_flag list -> string -> t_seekable

open_file file creates an out stream writing into the given file.

  • parameter mode

    permissions for the file creation

  • parameter flags

    set of unix flags to use. It must contain write permissions.

Sourceval with_open_file : ?close_noerr:bool -> ?mode:int -> ?flags:open_flag list -> string -> (t_seekable -> 'a) -> 'a
Sourceval output : t -> bytes -> int -> int -> unit

Write the slice of bytes.

Sourceval close : t -> unit

Close the stream. Idempotent.

Sourceval output_string : t -> string -> unit

Output the whole string.

Sourceval output_int : t -> int -> unit

Output an integer in decimal notation.

Sourceval tee : t list -> t

tee ocs is an output that accepts bytes and writes them to every output in ocs. When closed, it closes all elements of oc.

Sourceclass map_char : (char -> char) -> t -> t
Sourceval map_char : (char -> char) -> t -> t

Transform the stream byte by byte