fdoc

functionmatchesprivate

logical function matches(list, id, name, entity)

True if entity id is named name, in lowercase, and is of class entity.

Arguments

NameTypeIntentAttributesDescription
listtype(entity_list_t)in

the entities

idintegerin

the entity

namecharacter(len=*)in

the name

entitycharacter(len=*)in

the class

Result

NameTypeAttributesDescription
matcheslogical

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

Graphs

Calls

Called by