get_cla_from_buffer Subroutine

private subroutine get_cla_from_buffer(self, buffer, val, pref)

Get CLA (single) value from parsed value.

Type Bound

command_line_argument

Arguments

Type IntentOptional Attributes Name
class(command_line_argument), intent(inout) :: self

CLA data.

character(len=*), intent(in) :: buffer

Buffer containing values (parsed or default CLA value).

class(*), intent(inout) :: val

CLA value.

character(len=*), intent(in), optional :: pref

Prefixing string.


Calls

proc~~get_cla_from_buffer~~CallsGraph proc~get_cla_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_from_buffer cton cton proc~get_cla_from_buffer->cton proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~get_cla_from_buffer->proc~errored~2 interface~colorize face::colorize proc~errored~2->interface~colorize proc~print_error_message flap_object_t::object%print_error_message proc~errored~2->proc~print_error_message str str proc~errored~2->str proc~colorize_default face::colorize_default interface~colorize->proc~colorize_default proc~color_index face::color_index proc~colorize_default->proc~color_index proc~style_index face::style_index proc~colorize_default->proc~style_index proc~upper face::upper proc~colorize_default->proc~upper

Called by

proc~~get_cla_from_buffer~~CalledByGraph proc~get_cla_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_from_buffer proc~get_cla flap_command_line_argument_t::command_line_argument%get_cla proc~get_cla->proc~get_cla_from_buffer none~get flap_command_line_argument_t::command_line_argument%get none~get->proc~get_cla proc~get_cla_list~2 flap_command_line_interface_t::command_line_interface%get_cla_list proc~get_cla_list~2->none~get proc~get_cla~2 flap_command_line_interface_t::command_line_interface%get_cla proc~get_cla~2->none~get none~get~2 flap_command_line_interface_t::command_line_interface%get none~get~2->proc~get_cla_list~2 none~get~2->proc~get_cla~2 proc~fake_call flap_test_group::fake_call proc~fake_call->none~get~2 program~flap_save_man_page flap_save_man_page program~flap_save_man_page->none~get~2 program~flap_save_usage_to_markdown flap_save_usage_to_markdown program~flap_save_usage_to_markdown->none~get~2 program~flap_test_action_store flap_test_action_store program~flap_test_action_store->none~get~2 program~flap_test_ansi_color_style flap_test_ansi_color_style program~flap_test_ansi_color_style->none~get~2 program~flap_test_basic flap_test_basic program~flap_test_basic->none~get~2 program~flap_test_choices_logical flap_test_choices_logical program~flap_test_choices_logical->none~get~2 program~flap_test_duplicated_clas flap_test_duplicated_clas program~flap_test_duplicated_clas->none~get~2 program~flap_test_group_examples flap_test_group_examples program~flap_test_group_examples->none~get~2 program~flap_test_hidden flap_test_hidden program~flap_test_hidden->none~get~2 program~flap_test_ignore_unknown_clas flap_test_ignore_unknown_clas program~flap_test_ignore_unknown_clas->none~get~2 program~flap_test_minimal flap_test_minimal program~flap_test_minimal->none~get~2 program~flap_test_nargs_insufficient flap_test_nargs_insufficient program~flap_test_nargs_insufficient->none~get~2 program~flap_test_nargs_insufficient~2 flap_test_nargs_insufficient program~flap_test_nargs_insufficient~2->none~get~2 program~flap_test_nested flap_test_nested program~flap_test_nested->none~get~2 program~flap_test_string flap_test_string program~flap_test_string->none~get~2 program~flap_test_group flap_test_group program~flap_test_group->proc~fake_call

Source Code

  subroutine get_cla_from_buffer(self, buffer, val, pref)
  !< Get CLA (single) value from parsed value.
  implicit none
  class(command_line_argument), intent(inout) :: self   !< CLA data.
  character(*),                 intent(in)    :: buffer !< Buffer containing values (parsed or default CLA value).
  class(*),                     intent(inout) :: val    !< CLA value.
  character(*), optional,       intent(in)    :: pref   !< Prefixing string.

  select type(val)
#if defined _R16P
  type is(real(R16P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1._R16P)
#endif
  type is(real(R8P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1._R8P)
  type is(real(R4P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1._R4P)
  type is(integer(I8P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1_I8P)
  type is(integer(I4P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1_I4P)
  type is(integer(I2P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1_I2P)
  type is(integer(I1P))
    val = cton(pref=pref, error=self%error, str=trim(adjustl(buffer)), knd=1_I1P)
  type is(logical)
    read(buffer, *, iostat=self%error)val
    if (self%error/=0) call self%errored(pref=pref, error=ERROR_CASTING_LOGICAL, log_value=buffer)
  type is(character(*))
    val = buffer
  endselect
  endsubroutine get_cla_from_buffer