Allocate a json_value pointer and make it an object variable. The pointer should not already be allocated.
type(json_value),pointer :: p
type(json_core) :: json
call json%create_object(p,'objectname')
Note
The name is not significant for the root structure or an array element. In those cases, an empty string can be used.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | pointer | :: | p | |||
character(kind=CK, len=*), | intent(in) | :: | name |
subroutine json_value_create_object(json,p,name) implicit none class(json_core),intent(inout) :: json type(json_value),pointer :: p character(kind=CK,len=*),intent(in) :: name call json_value_create(p) call json%to_object(p,name) end subroutine json_value_create_object