sig
module Raw :
sig
type cp =
Config_file.Raw.cp =
String of string
| Int of int
| Float of float
| List of cp list
| Tuple of cp list
| Section of (string * cp) list
val of_string : string -> cp
val to_channel : out_channel -> cp -> unit
end
type 'a wrappers =
'a Config_file.wrappers = {
to_raw : 'a -> Raw.cp;
of_raw : Raw.cp -> 'a;
}
exception Wrong_type of (out_channel -> unit)
class type ['a] cp =
object
method add_hook : ('a -> 'a -> unit) -> unit
method get : 'a
method get_default : 'a
method get_default_formatted : Format.formatter -> unit
method get_formatted : Format.formatter -> unit
method get_help : string
method get_help_formatted : Format.formatter -> unit
method get_name : string list
method get_short_name : string option
method get_spec : Arg.spec
method reset : unit
method set : 'a -> unit
method set_raw : Raw.cp -> unit
method set_short_name : string -> unit
end
type groupable_cp =
< get_default_formatted : Format.formatter -> unit;
get_formatted : Format.formatter -> unit; get_help : string;
get_help_formatted : Format.formatter -> unit;
get_name : string list; get_short_name : string option;
get_spec : Arg.spec; reset : unit; set_raw : Raw.cp -> unit >
exception Double_name
exception Missing_cp of groupable_cp
class group :
object
method add : 'a cp -> unit
method command_line_args :
section_separator:string -> (string * Arg.spec * string) list
method read :
?obsoletes:string ->
?no_default:bool ->
?on_type_error:(groupable_cp ->
Raw.cp ->
(out_channel -> unit) -> string -> in_channel -> unit) ->
string -> unit
method write : ?with_help:bool -> string -> unit
end
class int_cp :
?group:group ->
string list -> ?short_name:string -> int -> string -> [int] cp
class float_cp :
?group:group ->
string list -> ?short_name:string -> float -> string -> [float] cp
class bool_cp :
?group:group ->
string list -> ?short_name:string -> bool -> string -> [bool] cp
class string_cp :
?group:group ->
string list -> ?short_name:string -> string -> string -> [string] cp
class ['a] list_cp :
'a wrappers ->
?group:group ->
string list -> ?short_name:string -> 'a list -> string -> ['a list] cp
class ['a] option_cp :
'a wrappers ->
?group:group ->
string list ->
?short_name:string -> 'a option -> string -> ['a option] cp
class ['a] enumeration_cp :
(string * 'a) list ->
?group:group ->
string list -> ?short_name:string -> 'a -> string -> ['a] cp
class ['a, 'b] tuple2_cp :
'a wrappers ->
'b wrappers ->
?group:group ->
string list -> ?short_name:string -> 'a * 'b -> string -> ['a * 'b] cp
class ['a, 'b, 'c] tuple3_cp :
'a wrappers ->
'b wrappers ->
'c wrappers ->
?group:group ->
string list ->
?short_name:string -> 'a * 'b * 'c -> string -> ['a * 'b * 'c] cp
class ['a, 'b, 'c, 'd] tuple4_cp :
'a wrappers ->
'b wrappers ->
'c wrappers ->
'd wrappers ->
?group:group ->
string list ->
?short_name:string ->
'a * 'b * 'c * 'd -> string -> ['a * 'b * 'c * 'd] cp
class string2_cp :
?group:group ->
string list ->
?short_name:string ->
string * string -> string -> [string, string] tuple2_cp
class font_cp :
?group:group ->
string list -> ?short_name:string -> string -> string -> string_cp
class filename_cp :
?group:group ->
string list -> ?short_name:string -> string -> string -> string_cp
val int_wrappers : int wrappers
val float_wrappers : float wrappers
val bool_wrappers : bool wrappers
val string_wrappers : string wrappers
val list_wrappers : 'a wrappers -> 'a list wrappers
val option_wrappers : 'a wrappers -> 'a option wrappers
val enumeration_wrappers : (string * 'a) list -> 'a wrappers
val tuple2_wrappers : 'a wrappers -> 'b wrappers -> ('a * 'b) wrappers
val tuple3_wrappers :
'a wrappers -> 'b wrappers -> 'c wrappers -> ('a * 'b * 'c) wrappers
val tuple4_wrappers :
'a wrappers ->
'b wrappers -> 'c wrappers -> 'd wrappers -> ('a * 'b * 'c * 'd) wrappers
class ['a] cp_custom_type :
'a wrappers ->
?group:group ->
string list -> ?short_name:string -> 'a -> string -> ['a] cp
type 'a option_class = 'a Config_file.option_class
type 'a option_record = 'a Config_file.option_record
type options_file = Config_file.options_file
val create_options_file : string -> options_file
val set_options_file : options_file -> string -> unit
val load : options_file -> unit
val append : options_file -> string -> unit
val save : options_file -> unit
val save_with_help : options_file -> unit
val option_hook : 'a option_record -> (unit -> unit) -> unit
val string_option : string option_class
val color_option : string option_class
val font_option : string option_class
val int_option : int option_class
val bool_option : bool option_class
val float_option : float option_class
val string2_option : (string * string) option_class
val option_option : 'a option_class -> 'a option option_class
val list_option : 'a option_class -> 'a list option_class
val sum_option : (string * 'a) list -> 'a option_class
val tuple2_option :
'a option_class * 'b option_class -> ('a * 'b) option_class
val tuple3_option :
'a option_class * 'b option_class * 'c option_class ->
('a * 'b * 'c) option_class
val tuple4_option :
'a option_class * 'b option_class * 'c option_class * 'd option_class ->
('a * 'b * 'c * 'd) option_class
val ( !! ) : 'a option_record -> 'a
val ( =:= ) : 'a option_record -> 'a -> unit
val shortname : 'a option_record -> string
val get_help : 'a option_record -> string
type option_value =
Config_file.option_value =
Module of option_module
| StringValue of string
| IntValue of int
| FloatValue of float
| List of option_value list
| SmallList of option_value list
and option_module = (string * option_value) list
val define_option_class :
string -> (option_value -> 'a) -> ('a -> option_value) -> 'a option_class
val to_value : 'a option_class -> 'a -> option_value
val from_value : 'a option_class -> option_value -> 'a
val value_to_string : option_value -> string
val string_to_value : string -> option_value
val value_to_int : option_value -> int
val int_to_value : int -> option_value
val bool_of_string : string -> bool
val value_to_bool : option_value -> bool
val bool_to_value : bool -> option_value
val value_to_float : option_value -> float
val float_to_value : float -> option_value
val value_to_string2 : option_value -> string * string
val string2_to_value : string * string -> option_value
val value_to_list : (option_value -> 'a) -> option_value -> 'a list
val list_to_value : ('a -> option_value) -> 'a list -> option_value
end