pygccxml.declarations.matcher'.matcher

Package pygccxml :: Package declarations :: Module matcher' :: Class matcher |

# ClassType matcher

source code

class-namespace, contains implementation of few "find" algorithms and definition of related exception classes

Nested Classes
declaration_not_found_t exception, that will be raised, if the declaration could not be found
multiple_declarations_found_t exception, that will be raised, if more than one declaration was found

Static Methods
find(decl_matcher, decls, recursive=True) returns a list of declarations that match "decl_matcher" defined criretia or None | source code
find_single(decl_matcher, decls, recursive=True) returns a reference to declaration, that match "decl_matcher" defined criretia, if a unique declaration could not be found the method will return None. | source code
get_single(decl_matcher, decls, recursive=True) returns a reference to declaration, that match "decl_matcher" defined criretia, if a unique declaration could not be found, an appropriate exception will be raised. | source code

Method Details

### find(decl_matcher, decls, recursive=True) Static Method | source code
returns a list of declarations that match "decl_matcher" defined criretia or None Parameters: `decl_matcher` - Python callable object, that takes one argument - reference to declaration `decls` - reference to declaration or list of declarations to be searched in `recursive` - boolean, if True the method will run decl_matcher, on internal declarations too

### find_single(decl_matcher, decls, recursive=True) Static Method | source code
returns a reference to declaration, that match "decl_matcher" defined criretia, if a unique declaration could not be found the method will return None. Parameters: `decl_matcher` - Python callable object, that takes one argument - reference to declaration `decls` - reference to declaration or list of declarations to be searched in `recursive` - boolean, if True the method will run decl_matcher, on internal declarations too

### get_single(decl_matcher, decls, recursive=True) Static Method | source code
returns a reference to declaration, that match "decl_matcher" defined criretia, if a unique declaration could not be found, an appropriate exception will be raised. Parameters: `decl_matcher` - Python callable object, that takes one argument - reference to declaration `decls` - reference to declaration or list of declarations to be searched in `recursive` - boolean, if True the method will run decl_matcher, on internal declarations too