Roman Yakovenko wrote:
> On Sat, Nov 1, 2008 at 12:06 PM, Paul Melis
> <pyp...@as...> wrote:
>
>> Roman Yakovenko wrote:
>>
>>> As I promised, I checked how the querying for declarations works.
>>> Basically you can search for a declaration:
>>> * using full name - "::x::y::z"
>>> * using its name only - "z"
>>>
>>> In the past, I choose this method to prevent confusions.
>>>
>>>
>> Thanks for verifying!
>>
>>> Pay attention, searching for "x::y::z" will not work and will raise an
>>> exception.
>>>
>>>
>> That's good to know, I indeed was expecting that form to work, but it
>> makes sense to exclude it.
>>
>
> Good.
>
>
>> Is there a way to match (part of) a declaration on by string? Say I want
>> all methods that have parameter types with some string S in them, where
>> I just want to match the declaration string.
>>
>
> mb = module_builder_t(...)
> mb.global_ns.decls( lambda d: 'xyz' in d.decl_string )
>
> Is this what you are looking for?
>
Sort of, but applied to arguments, e.g.
for mf in main_ns.member_functions(arg_types=lambda d: 'blah' in
d.decl_string):
# do something with mf
But this doesn't seem to work...
Paul
|