Closed iMichka closed 8 years ago
Good evening. Michka, the functionality you are asking for exists and even more. Please take a look on cpptypes.py file type_t.decl_string method implementation. It does exactly what you are asking for. But this is not all. In my opinion, comparing types to string is en error prone approach. For this purpose, I created type_traits.py module. It contains different "type_traits" functions, built very similar to boost::type_traits.
HTH
Hi
sorry for the long delay. I almost forgot that you answered. Thanks for the hint.
I have read more parts of pygccxml's code, and found what you are mentioning. I will make sure to use the right methods (it's just, I did not know about these when I first wrote that bunch of code 1-2 years ago).
You are welcome. I recently used the recent pygccxml version with castxml and it was a pleasure. Thank you very much.
I wrote a small example demonstrating the usage of is_std_string and is_reference, which shows how that can be used to achieve what I wanted to dO. This works only with the current develop version (e.g. the future v1.8.0). http://pygccxml.readthedocs.io/en/develop/examples/functions/example.html
I can close this now. I'll make a patch in ITK as soon as I update to version 1.8.0 there.
In ITK we need to fetch the type of an argument. For this, I hacked some code together, but there could be a method for this in pygccxml 1.7.0. Using str() is not really intuitive; and also not documented.
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py#L698