json_get_tail Subroutine

private subroutine json_get_tail(json, p, tail)

Returns a pointer to the tail of a json_value (the last child of an array of object). If there is no tail, then a null() pointer is returned.

Type Bound

json_core

Arguments

Type IntentOptional Attributes Name
class(json_core), intent(inout) :: json
type(json_value), intent(in), pointer :: p

JSON object

type(json_value), intent(out), pointer :: tail

pointer to tail


Calls

proc~~json_get_tail~~CallsGraph proc~json_get_tail json_core%json_get_tail none~throw_exception json_core%throw_exception proc~json_get_tail->none~throw_exception proc~json_throw_exception json_core%json_throw_exception none~throw_exception->proc~json_throw_exception

Source Code

    subroutine json_get_tail(json,p,tail)

    implicit none

    class(json_core),intent(inout)       :: json
    type(json_value),pointer,intent(in)  :: p        !! JSON object
    type(json_value),pointer,intent(out) :: tail     !! pointer to `tail`

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

    end subroutine json_get_tail