示例#1
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        data_object = self.data_object
        node_stack = stack(data_object, ancestors)

        if filter_.allow(node_stack):
            matches.append(node_stack)

        if data_object.kind == 'enum':
            for value in data_object.enumvalue:
                value_stack = stack(value, node_stack)
                if filter_.allow(value_stack):
                    matches.append(value_stack)
示例#2
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        """Find nodes which match the filter. Doesn't test this node, only its children"""

        node_stack = stack(self.data_object, ancestors)
        compound_finder = self.item_finder_factory.create_finder(
            self.data_object.compounddef)
        compound_finder.filter_(node_stack, filter_, matches)
示例#3
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        """Find nodes which match the filter. Doesn't test this node, only its children"""

        node_stack = stack(self.data_object, ancestors)
        if filter_.allow(node_stack):
            matches.append(node_stack)

        for memberdef in self.data_object.memberdef:
            finder = self.item_finder_factory.create_finder(memberdef)
            finder.filter_(node_stack, filter_, matches)
示例#4
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        """Finds nodes which match the filter and continues checks to children"""

        node_stack = stack(self.data_object, ancestors)
        if filter_.allow(node_stack):
            matches.append(node_stack)

        for sectiondef in self.data_object.sectiondef:
            finder = self.item_finder_factory.create_finder(sectiondef)
            finder.filter_(node_stack, filter_, matches)

        for innerclass in self.data_object.innerclass:
            finder = self.item_finder_factory.create_finder(innerclass)
            finder.filter_(node_stack, filter_, matches)
示例#5
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        """Finds nodes which match the filter and continues checks to children

        Requires parsing the xml files referenced by the children for which we use the compound
        parser and continue at the top level of that pretending that this node is the parent of the
        top level node of the compound file.
        """

        node_stack = stack(self.data_object, ancestors)

        # Match against compound object
        if filter_.allow(node_stack):
            matches.append(node_stack)

        # Descend to member children
        members = self.data_object.get_member()
        # TODO: find a more precise type for the Doxygen nodes
        member_matches = []  # type: List[Any]
        for member in members:
            member_finder = self.item_finder_factory.create_finder(member)
            member_finder.filter_(node_stack, filter_, member_matches)

        # If there are members in this compound that match the criteria
        # then load up the file for this compound and get the member data objects
        if member_matches:
            file_data = self.compound_parser.parse(self.data_object.refid)
            finder = self.item_finder_factory.create_finder(file_data)

            for member_stack in member_matches:
                ref_filter = self.filter_factory.create_id_filter(
                    'memberdef', member_stack[0].refid)
                finder.filter_(node_stack, ref_filter, matches)
        else:
            # Read in the xml file referenced by the compound and descend into that as well
            file_data = self.compound_parser.parse(self.data_object.refid)
            finder = self.item_finder_factory.create_finder(file_data)
            finder.filter_(node_stack, filter_, matches)
示例#6
0
    def filter_(self, ancestors, filter_: Filter, matches) -> None:
        node_stack = stack(self.data_object, ancestors)

        # Match against member object
        if filter_.allow(node_stack):
            matches.append(node_stack)