Module OpamFile.Switch_config

type t = {
opam_version : OpamVersion.t;
synopsis : string;
repos : OpamTypes.repository_name list option;
paths : (OpamTypes.std_path * string) list;
variables : (OpamTypes.variable * OpamTypes.variable_contents) list;
opam_root : OpamTypes.dirname option;
wrappers : Wrappers.t;
env : OpamTypes.env_update list;
}
val variable : t -> OpamTypes.variable -> OpamTypes.variable_contents option
val path : t -> OpamTypes.std_path -> string option
val wrappers : t -> Wrappers.t
include IO_FILE with type t := t
type t

File contents

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 -> Stdlib.in_channel -> t
val read_from_string : ?⁠filename:t typed_file -> string -> t
val write_to_channel : ?⁠filename:t typed_file -> Stdlib.out_channel -> t -> unit
val write_to_string : ?⁠filename:t typed_file -> t -> string