Note:

You are viewing a development version of the library. Goto the latest version.

Module OASISSchema


module OASISSchema: sig .. end
Add fields to _oasis for plugin
Author(s): Sylvain Le Gall

type 'a t = 'a OASISSchema_intern.t 
val new_field : 'a t ->
OASISPlugin.all_t ->
OASISTypes.name ->
?default:'b ->
?since_version:string ->
'b OASISValues.t ->
(unit -> string) ->
'c OASISPlugin.prop -> ('a -> 'c -> 'b) -> PropList.Data.t -> 'b
new_field schm plugin_id name value help pivot_data sync Create a field for a plugin. Create a new field for the plugin defined by plugin_id in the schema schm. The field basename is name, for which we will add the name of the plugin and "X" before -- to know that this field is related to this plugin. value defines how to parse/print the valye. help is an helper text for this field. pivot_data and sync defines how to match back the datastructure where the result will be stored with the field in _oasis.

The result of this function is a getter that helps you to get the data from the field parsed in the _oasis file. You should use it to generate a datastructure (the one that will be used by sync).

val new_field_conditional : 'a t ->
OASISPlugin.all_t ->
OASISTypes.name ->
?default_cond:'b OASISExpr.choices ->
?default:'b ->
?since_version:string ->
'b OASISValues.t ->
(unit -> string) ->
'c OASISPlugin.prop ->
('a -> 'c -> 'b OASISExpr.choices) -> PropList.Data.t -> 'b OASISExpr.choices
Create a conditional field for a plugin. Sees OASISSchema.new_field for explanation. The extra default_cond parameter allows to define a complex default. If default_cond and default are defined together, they are concatened in this order.