module Conf: sig
.. end
Configuration management module.
type
t = string
val cons : t -> t -> t
exception Wrong_Conf of t * string
exception File_Wrong_Conf of t * int * string
exception Undefined of t * string
val set_int : ?root:string -> t -> int -> unit
val set_float : ?root:string -> t -> float -> unit
val set_bool : ?root:string -> t -> bool -> unit
val set_string : ?root:string -> t -> string -> unit
val set_list : ?root:string -> t -> string list -> unit
Links a value to the configuration keys.
val get_int : ?root:t -> ?default:int -> t -> int
val get_float : ?root:t -> ?default:float -> t -> float
val get_bool : ?root:t -> ?default:bool -> t -> bool
val get_string : ?root:t -> ?default:string -> t -> string
val get_list : ?root:t -> ?default:string list -> t -> string list
Retrieves the value associated with the given configuration key.
Using the default value if the key was not defined. Raising
the Undefined
exception else.
val ref_int : ?root:t -> ?default:int -> t -> int Pervasives.ref
val ref_float : ?root:t ->
?default:float -> t -> float Pervasives.ref
val ref_bool : ?root:t -> ?default:bool -> t -> bool Pervasives.ref
val ref_string : ?root:t ->
?default:string -> t -> string Pervasives.ref
val ref_list : ?root:t ->
?default:string list -> t -> string list Pervasives.ref
Retrieves a reference to the value associated with the given
configuration key.
val conf : string -> unit
Adds a value to the configuration keys, according to the given
correctly formated string: "type key :value"
Raises Wrong_Conf
in badly formated cases.
val read_file : string -> unit
Reads configuration values from the file associated with the given
filename.
Raises File_Wrong_Conf
with filename line and and error message
in case of a bad configuration file.