json_value_get_child Subroutine

private subroutine json_value_get_child(json, p, child)

Returns pointer to the first child of the object (or null() if it is not associated).

Arguments

TypeIntentOptionalAttributesName
class(json_core), intent(inout) :: json
type(json_value), intent(in), pointer:: p

object or array JSON data

type(json_value), pointer:: child

pointer to the child


Contents

Source Code


Source Code

    subroutine json_value_get_child(json, p, child)

    implicit none

    class(json_core),intent(inout)      :: json
    type(json_value),pointer,intent(in) :: p      !! object or array JSON data
    type(json_value),pointer            :: child  !! pointer to the child

    if (associated(p)) then
        child => p%children
    else
        nullify(child)
        call json%throw_exception('Error in json_value_get_child: '//&
                                  'pointer is not associated.')
    end if

    end subroutine json_value_get_child