json_value_add_string_vec Subroutine

private subroutine json_value_add_string_vec(me, name, val, trim_str, adjustl_str)

Arguments

Type IntentOptional AttributesName
type(json_value), , pointer:: me
character(kind=CK,len=*), intent(in) :: name

variable name

character(kind=CK,len=*), intent(in), dimension(:):: val

array of strings

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

if TRIM() should be called for each element

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

if ADJUSTL() should be called for each element

Description

Add an array of character strings to the structure.

Calls

proc~~json_value_add_string_vec~~CallsGraph proc~json_value_add_string_vec json_value_add_string_vec proc~json_value_create json_value_create proc~json_value_add_string_vec->proc~json_value_create interface~json_add json_add proc~json_value_add_string_vec->interface~json_add proc~to_array to_array proc~json_value_add_string_vec->proc~to_array interface~json_add->proc~json_value_add_string_vec proc~json_value_add_logical json_value_add_logical interface~json_add->proc~json_value_add_logical proc~json_value_add_double json_value_add_double interface~json_add->proc~json_value_add_double proc~json_value_add_member json_value_add_member interface~json_add->proc~json_value_add_member proc~json_value_add_integer json_value_add_integer interface~json_add->proc~json_value_add_integer proc~json_value_add_double_vec json_value_add_double_vec interface~json_add->proc~json_value_add_double_vec proc~json_value_add_logical_vec json_value_add_logical_vec interface~json_add->proc~json_value_add_logical_vec proc~json_value_add_integer_vec json_value_add_integer_vec interface~json_add->proc~json_value_add_integer_vec proc~json_value_add_string json_value_add_string interface~json_add->proc~json_value_add_string proc~destroy_json_data destroy_json_data proc~to_array->proc~destroy_json_data proc~json_value_add_logical->proc~json_value_create proc~json_value_add_logical->interface~json_add proc~to_logical to_logical proc~json_value_add_logical->proc~to_logical proc~json_value_add_double->proc~json_value_create proc~json_value_add_double->interface~json_add proc~to_double to_double proc~json_value_add_double->proc~to_double proc~json_value_add_integer->proc~json_value_create proc~json_value_add_integer->interface~json_add proc~to_integer to_integer proc~json_value_add_integer->proc~to_integer proc~json_value_add_double_vec->proc~json_value_create proc~json_value_add_double_vec->interface~json_add proc~json_value_add_double_vec->proc~to_array proc~json_value_add_logical_vec->proc~json_value_create proc~json_value_add_logical_vec->interface~json_add proc~json_value_add_logical_vec->proc~to_array proc~json_value_add_integer_vec->proc~json_value_create proc~json_value_add_integer_vec->interface~json_add proc~json_value_add_integer_vec->proc~to_array proc~json_value_add_string->proc~json_value_create proc~json_value_add_string->interface~json_add proc~escape_string escape_string proc~json_value_add_string->proc~escape_string proc~to_string to_string proc~json_value_add_string->proc~to_string proc~to_logical->proc~destroy_json_data proc~to_double->proc~destroy_json_data proc~to_integer->proc~destroy_json_data proc~to_string->proc~destroy_json_data
Help

Called By

proc~~json_value_add_string_vec~~CalledByGraph proc~json_value_add_string_vec json_value_add_string_vec interface~json_add json_add proc~json_value_add_string_vec->interface~json_add proc~json_value_add_string_vec_name_ascii json_value_add_string_vec_name_ascii proc~json_value_add_string_vec_name_ascii->proc~json_value_add_string_vec proc~wrap_json_value_add_string_vec wrap_json_value_add_string_vec proc~wrap_json_value_add_string_vec->proc~json_value_add_string_vec proc~json_value_add_string_vec_val_ascii json_value_add_string_vec_val_ascii proc~json_value_add_string_vec_val_ascii->proc~json_value_add_string_vec interface~json_add->proc~json_value_add_string_vec proc~json_value_add_logical json_value_add_logical interface~json_add->proc~json_value_add_logical proc~json_value_add_double json_value_add_double interface~json_add->proc~json_value_add_double proc~json_value_add_logical_vec json_value_add_logical_vec interface~json_add->proc~json_value_add_logical_vec proc~json_value_add_integer json_value_add_integer interface~json_add->proc~json_value_add_integer proc~json_value_add_double_vec json_value_add_double_vec interface~json_add->proc~json_value_add_double_vec proc~json_value_add_integer_vec json_value_add_integer_vec interface~json_add->proc~json_value_add_integer_vec proc~json_value_add_string json_value_add_string interface~json_add->proc~json_value_add_string proc~json_value_add_logical->interface~json_add proc~json_update_integer json_update_integer proc~json_update_integer->interface~json_add proc~test_7 test_7 proc~test_7->interface~json_add proc~json_value_add_double->interface~json_add proc~parse_array parse_array proc~parse_array->interface~json_add proc~parse_value parse_value proc~parse_array->proc~parse_value proc~json_value_add_logical_vec->interface~json_add proc~test_12 test_12 proc~test_12->interface~json_add interface~json_update json_update proc~test_12->interface~json_update proc~add_variables_to_input add_variables_to_input proc~add_variables_to_input->interface~json_add proc~parse_object parse_object proc~parse_object->interface~json_add proc~parse_object->proc~parse_object proc~parse_object->proc~parse_value proc~json_value_add_integer->interface~json_add proc~json_update_double json_update_double proc~json_update_double->interface~json_add proc~json_value_add_double_vec->interface~json_add proc~json_update_logical json_update_logical proc~json_update_logical->interface~json_add proc~test_2 test_2 proc~test_2->interface~json_add proc~test_2->proc~add_variables_to_input proc~test_2->interface~json_update proc~json_value_add_integer_vec->interface~json_add proc~json_update_string json_update_string proc~json_update_string->interface~json_add proc~test_4 test_4 proc~test_4->interface~json_add proc~json_value_add_string->interface~json_add proc~wrap_json_value_add_logical wrap_json_value_add_logical proc~wrap_json_value_add_logical->proc~json_value_add_logical proc~wrap_json_update_integer wrap_json_update_integer proc~wrap_json_update_integer->proc~json_update_integer interface~json_update->proc~json_update_integer interface~json_update->proc~json_update_double interface~json_update->proc~json_update_logical interface~json_update->proc~json_update_string proc~rename rename proc~rename->interface~json_update proc~json_file_update_integer json_file_update_integer proc~json_file_update_integer->interface~json_update proc~json_file_update_string json_file_update_string proc~json_file_update_string->interface~json_update proc~test_1 test_1 proc~test_1->interface~json_update proc~test_10 test_10 proc~test_10->interface~json_update proc~json_file_update_real json_file_update_real proc~json_file_update_real->interface~json_update proc~json_file_update_logical json_file_update_logical proc~json_file_update_logical->interface~json_update proc~wrap_json_file_update_integer wrap_json_file_update_integer proc~wrap_json_file_update_integer->proc~json_file_update_integer proc~json_file_update_string_name_ascii json_file_update_string_name_ascii proc~json_file_update_string_name_ascii->proc~json_file_update_string proc~wrap_json_file_update_string wrap_json_file_update_string proc~wrap_json_file_update_string->proc~json_file_update_string proc~json_file_update_string_val_ascii json_file_update_string_val_ascii proc~json_file_update_string_val_ascii->proc~json_file_update_string program~jf_test_1 jf_test_1 program~jf_test_1->proc~test_1 program~jf_test_10 jf_test_10 program~jf_test_10->proc~test_10 proc~wrap_json_file_update_real wrap_json_file_update_real proc~wrap_json_file_update_real->proc~json_file_update_real proc~wrap_json_file_update_logical wrap_json_file_update_logical proc~wrap_json_file_update_logical->proc~json_file_update_logical program~jf_test_7 jf_test_7 program~jf_test_7->proc~test_7 proc~wrap_json_value_add_double wrap_json_value_add_double proc~wrap_json_value_add_double->proc~json_value_add_double proc~parse_value->proc~parse_array proc~parse_value->proc~parse_object proc~json_parse_string json_parse_string proc~json_parse_string->proc~parse_value proc~json_parse_file json_parse_file proc~json_parse_file->proc~parse_value proc~wrap_json_parse_string wrap_json_parse_string proc~wrap_json_parse_string->proc~json_parse_string interface~json_parse json_parse interface~json_parse->proc~json_parse_string interface~json_parse->proc~json_parse_file proc~test_14 test_14 proc~test_14->interface~json_parse proc~test_8 test_8 proc~test_8->interface~json_parse proc~json_file_load json_file_load proc~json_file_load->interface~json_parse proc~json_file_load_from_string json_file_load_from_string proc~json_file_load_from_string->interface~json_parse program~jf_test_14 jf_test_14 program~jf_test_14->proc~test_14 program~jf_test_8 jf_test_8 program~jf_test_8->proc~test_8 proc~wrap_json_file_load_from_string wrap_json_file_load_from_string proc~wrap_json_file_load_from_string->proc~json_file_load_from_string proc~wrap_json_value_add_logical_vec wrap_json_value_add_logical_vec proc~wrap_json_value_add_logical_vec->proc~json_value_add_logical_vec program~jf_test_12 jf_test_12 program~jf_test_12->proc~test_12 proc~wrap_json_value_add_integer wrap_json_value_add_integer proc~wrap_json_value_add_integer->proc~json_value_add_integer proc~wrap_json_update_double wrap_json_update_double proc~wrap_json_update_double->proc~json_update_double proc~wrap_json_value_add_double_vec wrap_json_value_add_double_vec proc~wrap_json_value_add_double_vec->proc~json_value_add_double_vec proc~wrap_json_update_logical wrap_json_update_logical proc~wrap_json_update_logical->proc~json_update_logical program~jf_test_2 jf_test_2 program~jf_test_2->proc~test_2 proc~wrap_json_value_add_integer_vec wrap_json_value_add_integer_vec proc~wrap_json_value_add_integer_vec->proc~json_value_add_integer_vec proc~json_update_string_name_ascii json_update_string_name_ascii proc~json_update_string_name_ascii->proc~json_update_string proc~wrap_json_update_string wrap_json_update_string proc~wrap_json_update_string->proc~json_update_string proc~json_update_string_val_ascii json_update_string_val_ascii proc~json_update_string_val_ascii->proc~json_update_string program~jf_test_4 jf_test_4 program~jf_test_4->proc~test_4 proc~wrap_json_value_add_string wrap_json_value_add_string proc~wrap_json_value_add_string->proc~json_value_add_string proc~json_value_add_string_name_ascii json_value_add_string_name_ascii proc~json_value_add_string_name_ascii->proc~json_value_add_string proc~json_value_add_string_val_ascii json_value_add_string_val_ascii proc~json_value_add_string_val_ascii->proc~json_value_add_string
Help

Variables

TypeVisibility AttributesNameInitial
type(json_value), public, pointer:: var
integer(kind=IK), public :: i
logical(kind=LK), public :: trim_string
logical(kind=LK), public :: adjustl_string
character(kind=CK,len=:), public, allocatable:: str

Source Code

    subroutine json_value_add_string_vec(me, name, val, trim_str, adjustl_str)

    implicit none

    type(json_value),pointer                         :: me
    character(kind=CK,len=*),intent(in)              :: name        !! variable name
    character(kind=CK,len=*),dimension(:),intent(in) :: val         !! array of strings
    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

    type(json_value),pointer :: var
    integer(IK) :: i
    logical(LK) :: trim_string, adjustl_string
    character(kind=CK,len=:),allocatable :: str

    !if the string is to be trimmed or not:
    if (present(trim_str)) then
        trim_string = trim_str
    else
        trim_string = .false.
    end if
    if (present(adjustl_str)) then
        adjustl_string = adjustl_str
    else
        adjustl_string = .false.
    end if

    !create the variable as an array:
    call json_value_create(var)
    call to_array(var,name)

    !populate the array:
    do i=1,size(val)

        !the string to write:
        str = val(i)
        if (adjustl_string) str = adjustl(str)
        if (trim_string)    str = trim(str)

        !write it:
        call json_add(var, '', str)

        !cleanup
        deallocate(str)

    end do

    !add it:
    call json_add(me, var)

    !cleanup:
    nullify(var)

    end subroutine json_value_add_string_vec