Skip to content

Add method to fetch the type of an argument #15

@iMichka

Description

@iMichka

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

for arg in method.arguments:
        # arg.type is an instance, there is no clean API in pygccxml to get the
        # name of the type as a string. This functionnality needs to be added
        # to pygccxml. Meanwhile, we can use the __str__() method.
        if arg.type.__str__() == "std::string &":
            applyFileNames.append(arg.name)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions