Note:

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

Module PropList.Schema


module Schema: sig .. end
This module is a set of fields (Field.t and FieldRO.t) that can be addressed by their name (as string). Value can be set and retrieved as string only. However, the value itself is stored in its native type.

type ('a, 'b) value 
A value.
type ('a, 'b) t 
A schema.
val create : ?case_insensitive:bool -> PropList.name -> ('a, 'b) t
Create a schema.
val mem : ('a, 'b) t -> PropList.name -> bool
Check that the given field name exists.
val get : ('a, 'b) t -> PropList.Data.t -> PropList.name -> string
get t data nm Retrieve the string value of field nm from schema t stores in data.
val set : ('a, 'b) t ->
PropList.Data.t -> PropList.name -> ?context:'a -> string -> unit
set t data nm ~context str Parse string value str in ~context and stores it in data for field nm of schema t.
val fold : ('a -> PropList.name -> 'b -> (unit -> string) option -> 'a) ->
'a -> ('c, 'b) t -> 'a
fold f acc t Apply f acc field_name field_extra field_help in turn to all fields of schema t.
val iter : (PropList.name -> 'a -> (unit -> string) option -> unit) ->
('b, 'a) t -> unit
Same as PropList.Schema.fold except no accumulator are involved.
val name : ('a, 'b) t -> PropList.name
Get the name of the schema.