Re: [pygccxml-development] declarations string, stability
Brought to you by:
mbaas,
roman_yakovenko
From: Ben S. <bsc...@lu...> - 2007-12-08 21:07:54
|
Hi, =20 =20 You could use str(declaration). That'll print out the full signature of the member functions. str(declaration) is not good because: 1. it prints parameter names (which clearly are not part of the signature); 2. it adds a redundant "[member function]" description which I do not need and am afraid might change one day;=20 3. I don't think there are any guarantees the string format won't change in the future. =09 Otherwise, you'll probably have to write your own formatting function. I guess I could do it. I was just hoping pygccxml had it already, to save me some work... :P=20 =20 Nope, I guess everyone wants their own version of __str__() ;). =20 As a sidenote (for Roman), maybe it would be good to have hooks for a visiter pattern in declaration_t. Then it would obvious that if the user programmer wants to traverse the decl tree, there's a standard interface for doing so instead of the user having to manually traverse himself. Then the scopedef functionality wouldn't be needed. Instead, we could have a standard set of visitors which collect different types of decls and return them as a list or mdecl_wrapper_t like scopedef.*s() does now... I know this would be useful because I had to search for decls based on their attributes which wasn't a param in scopedef.member_functions(..) so I had to manually test the attributes anyway. =20 Cheers Ben =20 |