X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fregistry%2Fhelm_registry.mli;h=1f40b5453fa0e352b859e352b41b4b9426d53c23;hb=c5d5bf37b1e4c4b9b499ed2cbfe27cf2ec181944;hp=f50d9b4a9711485e8aa86f5f1c2cf65f0cd79ceb;hpb=27ebca99c83f84c5a3915695e3f78b36c4fbcedf;p=helm.git diff --git a/helm/ocaml/registry/helm_registry.mli b/helm/ocaml/registry/helm_registry.mli index f50d9b4a9..1f40b5453 100644 --- a/helm/ocaml/registry/helm_registry.mli +++ b/helm/ocaml/registry/helm_registry.mli @@ -54,6 +54,13 @@ * - the whole key is uppercased * - each "." is converted to "__" * E.g.: my.foo_ish.application -> MY__FOO_ISH__APPLICATION + * + * ++ Variable interpolation ++ + * + * Interpolation is supported with the following syntax: + * + * foo.bar = "quux" + * foo.baz = $(foo.bar)/baz *) (** raised when a looked up key can't be found @@ -126,6 +133,12 @@ val set_string_list: key:string -> value:string list -> unit * set_* function above. Returned value is a get (set) function typed as the * given getter (setter) whith optional values. None is returned for missing * keys and None can be assigned to a key removing it from the registry. + * + * Sample usage: + * + * match Helm_registry.get_opt Helm_registry.get_int "foo.bar" with + * | Some i -> ... + * | None -> ... *) val get_opt: @@ -134,6 +147,8 @@ val get_opt: val set_opt: (key:string -> value:'a -> unit) (* setter *) -> key:string -> value:'a option -> unit +val get_opt_default: (* as get_opt with an additional default value *) + (string -> 'a) -> 'a -> string -> 'a (** {2 Validators} * Each key may have zero or more associated validators, that are predicates @@ -159,8 +174,10 @@ val add_validator: * Validators aren't saved. load_from/save_to sequences don't preserve comments *) - (** @param fname file to which save current configuration *) -(* val save_to: string -> unit *) + (** @param fname file to which save current configuration + * If xmllint is available then it will be used for pretty printing fname, + * otherwise fname will be in the usual pxp ugly format *) +val save_to: string -> unit (** @param fname file from which load new configuration. If it's an absolute * file name "path" argument is ignored. @@ -171,8 +188,6 @@ val add_validator: *) val load_from: ?path:string list -> string -> unit -(* (* DEBUGGING *) -val dump: unit -> unit -*) +(* val dump: unit -> unit *)