Skip to content

Feature request: respect typedef enum names #477

@jpsacha

Description

@jpsacha

One of the patterns of using C enums is to use them in combination with typedef (for instance in Spinnaker API). Consider following enum definition.

typedef enum _ENameSpace
{
    Custom,
    Standard,
    _UndefinedNameSpace
} ENameSpace;

Using "new Info().enumerate()" a Java enum class named _ENameSpace is generated:

@Namespace("Spinnaker::GenApi") public enum _ENameSpace {
    ...
}

But the usage in the original code (C++) is without underscore: ENameSpace. The request is to provide option to make javacpp to create class without "_", using typedef name ENameSpace.

Note: following suggested in the mailing list does not work (will not create enum named ENameSpace)

new Info("Spinnaker::GenApi::ENameSpace").enumerate().javaNames("ENameSpace")

Note: a work around to make _ENameSpace work is to use:

new Info("ENameSpace")
      .valueTypes("_ENameSpace")
      .pointerTypes("@Cast(\"ENameSpace*\") @ByPtrPtr _ENameSpace")

in Java code you then need to use _ENameSpace

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions