A namelist group: a name, doc, growable key list, parse-state, and an optional cross-key validation callback.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| procedure(group_check_iface), | public, | pointer, nopass | :: | cross_check | => | null() |
Optional cross-key validator (empty string = OK). |
| character(len=:), | public, | allocatable | :: | doc |
Group description. |
||
| logical, | public | :: | found | = | .false. |
Parse-state: true when the group appears in the file. |
|
| type(nml_key_box_t), | public, | allocatable | :: | keys(:) |
Registered keys. |
||
| character(len=:), | public, | allocatable | :: | name |
Group name (matched case-insensitively). |
Add a key to the group (sourced-allocate into a box). Error stop on duplicate key name (programming error).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_group_t), | intent(inout) | :: | this | |||
| class(nml_key_t), | intent(in) | :: | key |
Index of name in the group’s key list, 0 if absent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_group_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
type :: nml_group_t !! A namelist group: a name, doc, growable key list, parse-state, !! and an optional cross-key validation callback. character(len=:), allocatable :: name !! Group name (matched case-insensitively). character(len=:), allocatable :: doc !! Group description. type(nml_key_box_t), allocatable :: keys(:) !! Registered keys. logical :: found = .false. !! Parse-state: true when the group appears in the file. procedure(group_check_iface), pointer, nopass :: cross_check => null() !! Optional cross-key validator (empty string = OK). contains procedure :: add => group_add procedure :: find_key => group_find_key end type nml_group_t