Add a string value to a json_value, given the path.
then this routine will destroy it and replace it with the
new value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(json_core), | intent(inout) | :: | json | |||
| type(json_value), | pointer | :: | me |
the JSON structure |
||
| character(kind=CK, len=*), | intent(in) | :: | path |
the path to the variable |
||
| character(kind=CK, len=*), | intent(in) | :: | value |
the value to add |
||
| logical(kind=LK), | intent(out), | optional | :: | found |
if the variable was found |
|
| logical(kind=LK), | intent(out), | optional | :: | was_created |
if the variable had to be created |
|
| logical(kind=LK), | intent(in), | optional | :: | trim_str |
if |
|
| logical(kind=LK), | intent(in), | optional | :: | adjustl_str |
if |
subroutine json_add_string_by_path(json,me,path,value,found,& was_created,trim_str,adjustl_str) implicit none character(kind=CK,len=*),intent(in) :: value !! the value to add logical(LK),intent(in),optional :: trim_str !! if `trim()` should be called for each element logical(LK),intent(in),optional :: adjustl_str !! if `adjustl()` should be called for each element integer(IK),parameter :: json_type = json_string !! type of the value to add #include "json_add_scalar_by_path.inc" contains subroutine assign() p%str_value = value end subroutine assign subroutine create() call json%create_string(tmp,value,name,trim_str,adjustl_str) end subroutine create end subroutine json_add_string_by_path