wrap_json_get_path Subroutine

private subroutine wrap_json_get_path(json, p, path, found, use_alt_array_tokens, path_sep)

Wrapper for json_get_path where "path" and "path_sep" are kind=CDK.

Arguments

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

a JSON linked list object

character(kind=CDK,len=:), intent(out), allocatable:: path

path to the variable

logical(kind=LK), intent(out), optional :: found

true if there were no problems

logical(kind=LK), intent(in), optional :: use_alt_array_tokens

if true, then '()' are used for array elements otherwise, '[]' are used [default]

character(kind=CDK,len=1), intent(in), optional :: path_sep

character to use for path separator (default is '.')


Calls

proc~~wrap_json_get_path~~CallsGraph proc~wrap_json_get_path wrap_json_get_path interface~to_unicode to_unicode proc~wrap_json_get_path->interface~to_unicode proc~to_uni_vec to_uni_vec interface~to_unicode->proc~to_uni_vec proc~to_uni to_uni interface~to_unicode->proc~to_uni

Contents

Source Code


Source Code

    subroutine wrap_json_get_path(json, p, path, found, use_alt_array_tokens, path_sep)

    implicit none

    class(json_core),intent(inout)                    :: json
    type(json_value),pointer,intent(in)               :: p     !! a JSON linked list object
    character(kind=CDK,len=:),allocatable,intent(out) :: path  !! path to the variable
    logical(LK),intent(out),optional                  :: found !! true if there were no problems
    logical(LK),intent(in),optional :: use_alt_array_tokens    !! if true, then '()' are used
                                                               !! for array elements otherwise,
                                                               !! '[]' are used [default]
    character(kind=CDK,len=1),intent(in),optional :: path_sep  !! character to use for path
                                                               !! separator (default is '.')

    character(kind=CK,len=:),allocatable :: ck_path  !! path to the variable

    ! call the main routine:
    if (present(path_sep)) then
        call json%get_path(p,ck_path,found,use_alt_array_tokens,to_unicode(path_sep))
    else
        call json%get_path(p,ck_path,found,use_alt_array_tokens)
    end if

    ! from unicode:
    path = ck_path

    end subroutine wrap_json_get_path