json_valid_path Function

private function json_valid_path(json, p, path) result(found)

Returns true if the path is present in the p JSON structure.

Note

Just a wrapper for json_get_by_path, so it uses the specified path_mode and other settings.

Type Bound

json_core

Arguments

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

a JSON linked list

character(kind=CK, len=*), intent(in) :: path

path to the variable

Return Value logical(kind=LK)

true if it was found


Source Code

    function json_valid_path(json, p, path) result(found)

    implicit none

    class(json_core),intent(inout)       :: json
    type(json_value),pointer,intent(in)  :: p      !! a JSON linked list
    character(kind=CK,len=*),intent(in)  :: path   !! path to the variable
    logical(LK)                          :: found  !! true if it was found

    type(json_value),pointer :: tmp  !! pointer to the variable specified by `path`

    call json%get(p, path, tmp, found)

    end function json_valid_path