Return
.true.
if there exists apair_type
object insidepair_arr
with aname
attribute equal to the providedname
; otherwise, return.false.
. HTTP pairs are case-insensitive, implying that values are converted to lowercase before the comparison is performed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pair_type), | intent(in) | :: | pair_arr(:) |
The array in which we want to find a |
||
character(len=*), | intent(in) | :: | name |
The |
pure logical function pair_has_name(pair_arr, name)
!!> Return `.true.` if there exists a `pair_type` object inside `pair_arr` with
!!> a `name` attribute equal to the provided `name`; otherwise, return `.false.`.
!!> HTTP pairs are **case-insensitive**, implying that values are **converted to
!!> lowercase** before the comparison is performed.
type(pair_type), intent(in) :: pair_arr(:)
!! The array in which we want to find a `pair_type` instance with its
!! `name` attribute equal to the given `name`.
character(*), intent(in) :: name
!! The `name` to be searched in the `pair_arr`.
integer :: n
pair_has_name = .false.
do n = 1, size(pair_arr)
if (to_lower(name) == to_lower(pair_arr(n)%name)) then
pair_has_name = .true.
return
end if
end do
end function pair_has_name