In-memory sibling of schema_parse: validate + apply a namelist
already held as a lines(:) character array (no file touch).
Same error-return convention as schema_parse.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | lines(:) | |||
| integer, | intent(in) | :: | n_lines | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=:), | intent(out), | optional, | allocatable | :: | errors(:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=*), | private, | parameter | :: | LABEL | = | "<config-string>" | |
| character(len=:), | private, | allocatable | :: | err_buf(:) | |||
| integer, | private | :: | n_err |
subroutine schema_parse_lines(this, lines, n_lines, status, errors) !! In-memory sibling of `schema_parse`: validate + apply a namelist !! already held as a `lines(:)` character array (no file touch). !! Same error-return convention as `schema_parse`. class(nml_schema_t), intent(inout) :: this character(len=*), intent(in) :: lines(:) integer, intent(in) :: n_lines integer, intent(out), optional :: status character(len=:), allocatable, intent(out), optional :: errors(:) character(len=:), allocatable :: err_buf(:) integer :: n_err character(len=*), parameter :: LABEL = "<config-string>" n_err = 0 call reset_state(this) call parse_from_lines(this, lines, n_lines, LABEL, err_buf, n_err) call post_parse_validate(this, LABEL, err_buf, n_err, status, errors) end subroutine schema_parse_lines