json_value_create_string Subroutine

private subroutine json_value_create_string(json, p, val, name, trim_str, adjustl_str)

Allocate a json_value pointer and make it a string variable. The pointer should not already be allocated.


     type(json_value),pointer :: p
     type(json_core) :: json
     call json%create_string(p,'value','hello')


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

if TRIM() should be called for the val

logical(kind=LK), intent(in), optional :: adjustl_str

if ADJUSTL() should be called for the val


proc~~json_value_create_string~~CallsGraph proc~json_value_create_string json_value_create_string proc~json_value_create json_value_create proc~json_value_create_string->proc~json_value_create


Source Code

    subroutine json_value_create_string(json,p,val,name,trim_str,adjustl_str)

    implicit none

    class(json_core),intent(inout)      :: json
    type(json_value),pointer            :: p
    character(kind=CK,len=*),intent(in) :: val
    character(kind=CK,len=*),intent(in) :: name
    logical(LK),intent(in),optional     :: trim_str      !! if TRIM() should be called for the `val`
    logical(LK),intent(in),optional     :: adjustl_str   !! if ADJUSTL() should be called for the `val`

    call json_value_create(p)
    call json%to_string(p,val,name,trim_str,adjustl_str)

    end subroutine json_value_create_string