Get CLA (single) value from parsed value.
Type | Intent | Optional | 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. |
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