functionmatchesprivate
logical function matches(list, id, name, entity)
True if entity id is named name, in lowercase, and is of class entity.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | in | the entities | |
| id | integer | in | the entity | |
| name | character(len=*) | in | the name | |
| entity | character(len=*) | in | the class |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| matches | logical |
Calls
Source
Show the code
logical function matches(list, id, name, entity)
type(entity_list_t), intent(in) :: list !! the entities
integer, intent(in) :: id !! the entity
character(len=*), intent(in) :: name !! the name
character(len=*), intent(in) :: entity !! the class
character(len=:), allocatable :: file_name
integer :: at
matches = .false.
associate (e => list%box(id)%e)
if (.not. allocated(e%name) .or. e%kind == E_NONE) return
if (.not. of_class(e, entity)) return
if (e%kind == E_FILE) then
at = last_separator(e%name)
file_name = e%name(at + 1:)
matches = lowercase(file_name) == name
return
end if
matches = lowercase(e%name) == name
end associate
end function matches