Count the number of children.
n_children
variable.
Renamed from json_value_count
.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | intent(in), | pointer | :: | p |
number of children
function json_count(json,p) result(count)
implicit none
class(json_core),intent(inout) :: json
type(json_value),pointer,intent(in) :: p
integer(IK) :: count !! number of children
if (associated(p)) then
count = p%n_children
else
call json%throw_exception('Error in json_count: '//&
'pointer is not associated.')
end if
end function json_count