Wrapper for json_get_path where “path” and “path_sep” are kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 ‘.’) |
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