Add an integer value child to the json_value variable
This routine is part of the public API that can be used to build a JSON structure using json_value pointers.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | pointer | :: | p | |||
character(kind=CK,len=*), | intent(in) | :: | name | |||
integer(kind=IK), | intent(in) | :: | val |
subroutine json_value_add_integer(json, p, name, val)
implicit none
class(json_core),intent(inout) :: json
type(json_value),pointer :: p
character(kind=CK,len=*),intent(in) :: name
integer(IK),intent(in) :: val
type(json_value),pointer :: var
!create the variable:
call json%create_integer(var,val,name)
!add it:
call json%add(p, var)
end subroutine json_value_add_integer