Returns information about a json_value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | pointer | :: | p | |||
integer(kind=IK), | intent(out), | optional | :: | var_type | variable type |
|
integer(kind=IK), | intent(out), | optional | :: | n_children | number of children |
|
character(kind=CK,len=:), | intent(out), | optional | allocatable | :: | name | variable name |
subroutine json_info(json,p,var_type,n_children,name)
implicit none
class(json_core),intent(inout) :: json
type(json_value),pointer :: p
integer(IK),intent(out),optional :: var_type !! variable type
integer(IK),intent(out),optional :: n_children !! number of children
character(kind=CK,len=:),allocatable,intent(out),optional :: name !! variable name
if (present(var_type)) var_type = p%var_type
if (present(n_children)) n_children = json%count(p)
if (present(name)) then
if (allocated(p%name)) then
name = p%name
else
name = ''
end if
end if
end subroutine json_info