private subroutine json_value_remove_if_present(p, name)
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
type(json_value), |
intent(inout), |
|
pointer | :: |
p | |
character(kind=CK,len=*), |
intent(in) |
|
| :: |
name | |
Description
Given the path string, remove the variable from
the json_value structure, if it exists.
Variables
Type | Visibility |
Attributes | | Name | | Initial | |
type(json_value), |
public, |
pointer | :: |
p_var | | | |
logical(kind=LK), |
public |
| :: |
found | | | |
Source Code
subroutine json_value_remove_if_present(p,name)
implicit none
type(json_value),pointer :: p
character(kind=CK,len=*),intent(in) :: name
type(json_value),pointer :: p_var
logical(LK) :: found
call json_get(p,name,p_var,found)
if (found) call json_remove(p_var)
end subroutine json_value_remove_if_present