json_value_add_logical_vec Subroutine

private subroutine json_value_add_logical_vec(json, p, name, val)

Add a logical vector child to the json_value variable.

Note

This routine is part of the public API that can be used to build a JSON structure using json_value pointers.

Type Bound

json_core

Arguments

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

name of the vector

logical(kind=LK), intent(in), dimension(:) :: val

value


Calls

proc~~json_value_add_logical_vec~~CallsGraph proc~json_value_add_logical_vec json_core%json_value_add_logical_vec none~add~4 json_core%add proc~json_value_add_logical_vec->none~add~4 none~create_array json_core%create_array proc~json_value_add_logical_vec->none~create_array proc~json_value_add_string_name_ascii json_core%json_value_add_string_name_ascii none~add~4->proc~json_value_add_string_name_ascii proc~json_value_add_string_val_ascii json_core%json_value_add_string_val_ascii none~add~4->proc~json_value_add_string_val_ascii proc~json_value_add_string_vec_name_ascii json_core%json_value_add_string_vec_name_ascii none~add~4->proc~json_value_add_string_vec_name_ascii proc~json_value_add_string_vec_val_ascii json_core%json_value_add_string_vec_val_ascii none~add~4->proc~json_value_add_string_vec_val_ascii proc~json_value_create_array json_core%json_value_create_array none~create_array->proc~json_value_create_array proc~wrap_json_value_create_array json_core%wrap_json_value_create_array none~create_array->proc~wrap_json_value_create_array proc~json_value_add_string_name_ascii->none~add~4 interface~to_unicode to_unicode proc~json_value_add_string_name_ascii->interface~to_unicode proc~json_value_add_string_val_ascii->none~add~4 proc~json_value_add_string_val_ascii->interface~to_unicode proc~json_value_add_string_vec_name_ascii->none~add~4 proc~json_value_add_string_vec_name_ascii->interface~to_unicode proc~json_value_add_string_vec_val_ascii->none~add~4 proc~json_value_add_string_vec_val_ascii->interface~to_unicode proc~json_value_create json_value_create proc~json_value_create_array->proc~json_value_create proc~to_array json_core%to_array proc~json_value_create_array->proc~to_array proc~wrap_json_value_create_array->none~create_array proc~wrap_json_value_create_array->interface~to_unicode proc~to_uni to_uni interface~to_unicode->proc~to_uni proc~to_uni_vec to_uni_vec interface~to_unicode->proc~to_uni_vec proc~destroy_json_data destroy_json_data proc~to_array->proc~destroy_json_data

Source Code

    subroutine json_value_add_logical_vec(json, p, name, val)

    implicit none

    class(json_core),intent(inout)      :: json
    type(json_value),pointer            :: p
    character(kind=CK,len=*),intent(in) :: name  !! name of the vector
    logical(LK),dimension(:),intent(in) :: val   !! value

    type(json_value),pointer :: var
    integer(IK) :: i    !! counter

    !create the variable as an array:
    call json%create_array(var,name)

    !populate the array:
    do i=1,size(val)
        call json%add(var, CK_'', val(i))
    end do

    !add it:
    call json%add(p, var)

    end subroutine json_value_add_logical_vec