get_cla_list_from_buffer Subroutine

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

Get CLA multiple values from a buffer.

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(1:)

CLA value.

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

Prefixing string.


Calls

proc~~get_cla_list_from_buffer~~CallsGraph proc~get_cla_list_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_list_from_buffer cton cton proc~get_cla_list_from_buffer->cton proc~check_choices flap_command_line_argument_t::command_line_argument%check_choices proc~get_cla_list_from_buffer->proc~check_choices proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~get_cla_list_from_buffer->proc~errored~2 proc~tokenize flap_utils_m::tokenize proc~get_cla_list_from_buffer->proc~tokenize proc~check_choices->cton proc~check_choices->proc~errored~2 proc~check_choices->proc~tokenize str str proc~check_choices->str 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 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_list_from_buffer~~CalledByGraph proc~get_cla_list_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_list_from_buffer proc~get_cla_list flap_command_line_argument_t::command_line_argument%get_cla_list proc~get_cla_list->proc~get_cla_list_from_buffer none~get flap_command_line_argument_t::command_line_argument%get none~get->proc~get_cla_list 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_list_from_buffer(self, buffer, val, pref)
  !< Get CLA multiple values from a buffer.
  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(1:) !< CLA value.
  character(*), optional,       intent(in)    :: pref    !< Prefixing string.
  integer(I4P)                                :: Nv      !< Number of values.
  character(len=len(buffer)), allocatable     :: vals(:) !< String array of values based on buffer value.
  integer(I4P)                                :: v       !< Values counter.

  call tokenize(strin=buffer, delimiter=args_sep, toks=vals, Nt=Nv)
  select type(val)
#if defined _R16P
  type is(real(R16P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1._R16P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
#endif
  type is(real(R8P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1._R8P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(real(R4P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1._R4P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(integer(I8P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1_I8P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(integer(I4P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1_I4P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(integer(I2P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1_I2P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(integer(I1P))
    do v=1, Nv
      val(v) = cton(pref=pref,error=self%error,str=trim(adjustl(vals(v))),knd=1_I1P)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  type is(logical)
    do v=1, Nv
      read(vals(v),*,iostat=self%error)val(v)
      if (self%error/=0) then
        call self%errored(pref=pref,error=ERROR_CASTING_LOGICAL,log_value=vals(v))
        exit
      endif
    enddo
  type is(character(*))
    do v=1, Nv
      val(v)=vals(v)
      if (allocated(self%choices).and.self%error==0) call self%check_choices(val=val(v),pref=pref)
      if (self%error/=0) exit
    enddo
  endselect
  endsubroutine get_cla_list_from_buffer