package opam-format

  1. Overview
  2. Docs

Package descriptions: $opam/descr/

include IO_FILE
type t

File contents

val format_version : OpamVersion.t
val empty : t

Empty file

val write : t typed_file -> t -> unit

Write some contents to a file

val read : t typed_file -> t

Read file contents. Raise an error if the file does not exist.

val read_opt : t typed_file -> t option

Returns None on non-existing file

val safe_read : t typed_file -> t

Read file contents. Return empty if the file does not exist.

val read_from_channel : ?filename:t typed_file -> in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
val create : string -> t
val of_string : t typed_file -> string -> t

Create an abstract description file from a string

val synopsis : t -> string

Return the first line

val body : t -> string

Return the body

val full : t -> string

Return the full description

OCaml

Innovation. Community. Security.