module Inifiles:sig
..end
This library reads ini format property files
exception Invalid_section of string
raised if you ask for a section which doesn't exist
exception Invalid_element of string
raised if you ask for an element (attribute) which doesn't exist, or the element fails to match the validation regex
exception Missing_section of string
raised if a required section is not specified in the config file
exception Missing_element of string
raised if a required element is not specified in the config file
exception Ini_parse_error of (int * string)
raised if there is a parse error in the ini file it will contain the line number and the name of the file in which the error happened
type
attribute_specification = {
|
atr_name : |
|
atr_required : |
|
atr_default : |
|
atr_validator : |
}
The type of an attribute/element specification
type
section_specification = {
|
sec_name : |
|
sec_required : |
|
sec_attributes : |
}
The type of a section specification
typespecification =
section_specification list
The type of a secification
class inifile :?spec:specification -> string ->
object
..end
send the name of an ini file to the constructor the file must exist, but can be empty
val fold : ('a -> inifile -> 'a) -> string -> 'a -> 'a
Executes a fold left across a directory of ini files (skips files which do not end with .ini). fold f path a computes (f ... (f (f file1 a) file2) fileN)