get_toml_string Subroutine

public subroutine get_toml_string(table, key, value, context)

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
type(toml_key), intent(in) :: key
character(len=*), intent(out) :: value
character(len=*), intent(in) :: context

Calls

proc~~get_toml_string~~CallsGraph proc~get_toml_string get_toml_string get_value get_value proc~get_toml_string->get_value proc~require_toml_success require_toml_success proc~get_toml_string->proc~require_toml_success proc~stop_config_error stop_config_error proc~get_toml_string->proc~stop_config_error proc~require_toml_success->proc~stop_config_error

Called by

proc~~get_toml_string~~CalledByGraph proc~get_toml_string get_toml_string proc~get_toml_boundary_inflow_mode get_toml_boundary_inflow_mode proc~get_toml_boundary_inflow_mode->proc~get_toml_string proc~get_toml_particle_boundary_mode get_toml_particle_boundary_mode proc~get_toml_particle_boundary_mode->proc~get_toml_string

Source Code

  subroutine get_toml_string(table, key, value, context)
    type(toml_table), intent(inout) :: table
    type(toml_key), intent(in) :: key
    character(len=*), intent(out) :: value
    character(len=*), intent(in) :: context
    character(len=:), allocatable :: tmp
    integer :: stat

    call get_value(table, key, tmp, stat=stat)
    call require_toml_success(stat, context)
    if (.not. allocated(tmp)) call stop_config_error('Invalid TOML value for '//trim(context)//'.')
    if (len_trim(tmp) > len(value)) call stop_config_error(trim(context)//' is too long.')
    value = ''
    value = trim(tmp)
  end subroutine get_toml_string