OpamFile.Dot_config
.config files
include IO_FILE
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 : (OpamTypes.variable * OpamTypes.variable_contents) list -> t
Create a new .config file (containing only variables)
val file_depends : t -> (OpamTypes.filename * OpamHash.t) list
Dependency towards file-system paths and their hashes
val with_file_depends : (OpamTypes.filename * OpamHash.t) list -> t -> t
val with_vars : (OpamTypes.variable * OpamTypes.variable_contents) list -> t -> t
Sets all bindings in the file
val variable : t -> OpamTypes.variable -> OpamTypes.variable_contents option
Top-level variables
val variables : t -> OpamTypes.variable list
The list of top-level variables
val bindings : t -> (OpamTypes.variable * OpamTypes.variable_contents) list
Lists all the variable bindings in the file
val set : OpamTypes.variable -> OpamTypes.variable_contents option -> t -> t
Sets the given variable, overriding any previous definition. With None
, unsets the variable