json_value_add_string Subroutine

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

Add a character string 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 variable

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

value

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


Calls

proc~~json_value_add_string~~CallsGraph proc~json_value_add_string json_value_module::json_core%json_value_add_string none~add~2 json_value_module::json_core%add proc~json_value_add_string->none~add~2 none~create_string json_value_module::json_core%create_string proc~json_value_add_string->none~create_string proc~json_value_add_string_name_ascii json_value_module::json_core%json_value_add_string_name_ascii none~add~2->proc~json_value_add_string_name_ascii proc~json_value_add_string_val_ascii json_value_module::json_core%json_value_add_string_val_ascii none~add~2->proc~json_value_add_string_val_ascii proc~json_value_add_string_vec_name_ascii json_value_module::json_core%json_value_add_string_vec_name_ascii none~add~2->proc~json_value_add_string_vec_name_ascii proc~json_value_add_string_vec_val_ascii json_value_module::json_core%json_value_add_string_vec_val_ascii none~add~2->proc~json_value_add_string_vec_val_ascii proc~json_value_create_string json_value_module::json_core%json_value_create_string none~create_string->proc~json_value_create_string proc~wrap_json_value_create_string json_value_module::json_core%wrap_json_value_create_string none~create_string->proc~wrap_json_value_create_string proc~json_value_add_string_name_ascii->none~add~2 interface~to_unicode json_string_utilities::to_unicode proc~json_value_add_string_name_ascii->interface~to_unicode proc~json_value_add_string_val_ascii->none~add~2 proc~json_value_add_string_val_ascii->interface~to_unicode proc~json_value_add_string_vec_name_ascii->none~add~2 proc~json_value_add_string_vec_name_ascii->interface~to_unicode proc~json_value_add_string_vec_val_ascii->none~add~2 proc~json_value_add_string_vec_val_ascii->interface~to_unicode proc~json_value_create json_value_module::json_value_create proc~json_value_create_string->proc~json_value_create proc~to_string json_value_module::json_core%to_string proc~json_value_create_string->proc~to_string proc~wrap_json_value_create_string->none~create_string proc~wrap_json_value_create_string->interface~to_unicode proc~to_uni json_string_utilities::to_uni interface~to_unicode->proc~to_uni proc~to_uni_vec json_string_utilities::to_uni_vec interface~to_unicode->proc~to_uni_vec proc~destroy_json_data json_value_module::destroy_json_data proc~to_string->proc~destroy_json_data

Source Code

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

    implicit none

    class(json_core),intent(inout)      :: json
    type(json_value),pointer            :: p
    character(kind=CK,len=*),intent(in) :: name        !! name of the variable
    character(kind=CK,len=*),intent(in) :: val         !! value
    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`

    type(json_value),pointer :: var

    !create the variable:
    call json%create_string(var,val,name,trim_str,adjustl_str)

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

    end subroutine json_value_add_string