to_object Subroutine

private subroutine to_object(json, p, name)

Change the json_value variable to an object.

Arguments

Type IntentOptional AttributesName
class(json_core), intent(inout) :: json
type(json_value), pointer:: p
character(kind=CK,len=*), intent(in), optional :: name

if the name is also to be changed.


Calls

proc~~to_object~~CallsGraph proc~to_object to_object proc~destroy_json_data destroy_json_data proc~to_object->proc~destroy_json_data

Contents

Source Code


Source Code

    subroutine to_object(json,p,name)

    implicit none

    class(json_core),intent(inout)               :: json
    type(json_value),pointer                     :: p
    character(kind=CK,len=*),intent(in),optional :: name  !! if the name is also to be changed.

    !set type and value:
    call destroy_json_data(p)
    p%var_type = json_object

    !name:
    if (present(name)) call json%rename(p,name)

    end subroutine to_object