package scfg

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Module providing functions to search inside a config.

val get_dirs : string -> Types.directive list -> Types.directive list

Returns a list of directives with the provided name from a list of directives.

val get_dir : string -> Types.directive list -> Types.directive option

Returns the first directive with the provided name from a list of directive.

val get_dir_exn : string -> Types.directive list -> Types.directive

Same as get_dir but raises if no directive is found.

val get_params : int -> Types.directive -> (string list, string) result

Extract a given number of parameters from a directive.

val get_param : int -> Types.directive -> (string, string) result

Extract a parameter at a given index from a directive.

val get_param_exn : int -> Types.directive -> string

Same as get_param but raises if an error occurs.

val get_param_bool : int -> Types.directive -> (bool, string) result

Extract a bool parameter at a given index from a directive.

val get_param_bool_exn : int -> Types.directive -> bool

Same as get_param_bool but raises if an error occurs.

val get_param_int : int -> Types.directive -> (int, string) result

Extract an int parameter at a given index from a directive.

val get_param_int_exn : int -> Types.directive -> int

Same as get_param_int but raises if an error occurs.

val get_param_pos_int : int -> Types.directive -> (int, string) result

Extract a positive int parameter at a given index from a directive.

val get_param_pos_int_exn : int -> Types.directive -> int

Same as get_param_pos_int but raises if an error occurs.

val get_param_float : int -> Types.directive -> (float, string) result

Extract a float parameter at a given index from a directive.

val get_param_float_exn : int -> Types.directive -> float

Same as get_param_float but raises if an error occurs.

OCaml

Innovation. Community. Security.