Class Info


  • public class Info
    extends Object
    Holds information useful to the Parser and associated with C++ identifiers. Info objects are meant to be added by the user to an InfoMap passed as argument to InfoMapper.map(InfoMap). A class inheriting from the latter becomes a kind of configuration file entirely written in Java.

    For usage examples, one can refer to the source code of the default values defined in the initializer of InfoMap.defaults.

    Author:
    Samuel Audet
    • Field Detail

      • cppNames

        String[] cppNames
        A list of C++ identifiers, expressions, or header filenames to which this info is to be bound. Usually set via the constructor parameter of Info(String...).
      • javaNames

        String[] javaNames
        The Java identifiers to output corresponding to the C++ identifiers of cppNames. By default, the names of C++ identifiers cppNames are used.
      • annotations

        String[] annotations
        Additional Java annotations that should prefix the identifiers on output.
      • cppTypes

        String[] cppTypes
        A list of C++ types to supply to or substitute from macros, templates, typedefs, etc. By default, identifiers with missing type information are skipped, except for variable-like macros for which the type is guessed based on the expression.
      • valueTypes

        String[] valueTypes
        A list of (usually) primitive Java types to be used to map C++ value types. By default, pointerTypes prefixed with @ByVal are used.
      • pointerTypes

        String[] pointerTypes
        A list of (usually) Pointer Java subclasses to be used to map C++ pointer types. By default, the names of the C++ types cppNames are used.
      • linePatterns

        String[] linePatterns
        A list of regular expressions (start1, end1, start2, end2, ...) that are matched against lines in header files, where only the ones in between each pair are parsed (or not if skip is true).
      • cast

        boolean cast
        Annotates Java identifiers with @Cast containing C++ identifier names cppNames.
      • define

        boolean define
        Indicates expressions of conditional macro groups to parse, or templates to specialize.
      • enumerate

        boolean enumerate
        Maps native C++ enum classes to Java enum types, along with methods using them. To use as keys in maps, etc, intern() must be called on instances returned from native code.
      • flatten

        boolean flatten
        Outputs declarations for this class into their subclasses as well. Also adds methods for upcasting, as done for multiple inheritance by default.
      • friendly

        boolean friendly
        Maps friend functions. Only functions having in their argument list an instance of the class they are friend of are currently supported. They are mapped as instance methods of the class.
      • immutable

        boolean immutable
        Disables generation of setters for public data members of a class
      • beanify

        boolean beanify
        Adds JavaBeans-style prefixes to getters and setters of public data members of a class
      • objectify

        boolean objectify
        Map global functions to instance methods, without static modifier, to implement an interface, etc.
      • translate

        boolean translate
        Attempts to translate naively the statements of variable-like macros to Java.
      • skip

        boolean skip
        Skips entirely all the code associated with the C++ identifiers, expressions, or header filenames. Unless more Info is provided...
      • skipDefaults

        boolean skipDefaults
        Ignores default type constructors and default function arguments to avoid ambiguous C++ function calls.
      • purify

        boolean purify
        Forces a class to be treated as if it were abstract.
      • upcast

        boolean upcast
        Whether a static_cast is needed to upcast a pointer to this cppName. This is necessary for polymorphic classes that are virtually inherited from.
      • virtualize

        boolean virtualize
        Annotates virtual functions with @Virtual and adds appropriate constructors.
      • cppText

        String cppText
        Replaces the code associated with the declaration of C++ identifiers, before parsing.
      • javaText

        String javaText
        Outputs the given code, instead of the result parsed from the declaration of C++ identifiers.
    • Constructor Detail

      • Info

        public Info()
      • Info

        public Info​(String... cppNames)
      • Info

        public Info​(Info i)
    • Method Detail

      • cppNames

        public Info cppNames​(String... cppNames)
      • javaNames

        public Info javaNames​(String... javaNames)
      • annotations

        public Info annotations​(String... annotations)
      • cppTypes

        public Info cppTypes​(String... cppTypes)
      • valueTypes

        public Info valueTypes​(String... valueTypes)
      • pointerTypes

        public Info pointerTypes​(String... pointerTypes)
      • linePatterns

        public Info linePatterns​(String... linePatterns)
      • cast

        public Info cast()
      • cast

        public Info cast​(boolean cast)
      • define

        public Info define()
      • define

        public Info define​(boolean define)
      • enumerate

        public Info enumerate()
      • enumerate

        public Info enumerate​(boolean enumerate)
      • flatten

        public Info flatten()
      • flatten

        public Info flatten​(boolean flatten)
      • friendly

        public Info friendly()
      • friendly

        public Info friendly​(boolean friendly)
      • immutable

        public Info immutable()
      • immutable

        public Info immutable​(boolean immutable)
      • beanify

        public Info beanify()
      • beanify

        public Info beanify​(boolean beanify)
      • objectify

        public Info objectify()
      • objectify

        public Info objectify​(boolean objectify)
      • translate

        public Info translate()
      • translate

        public Info translate​(boolean translate)
      • skip

        public Info skip()
      • skip

        public Info skip​(boolean skip)
      • skipDefaults

        public Info skipDefaults()
      • skipDefaults

        public Info skipDefaults​(boolean skipDefaults)
      • purify

        public Info purify()
      • purify

        public Info purify​(boolean purify)
      • upcast

        public Info upcast()
      • upcast

        public Info upcast​(boolean upcast)
      • virtualize

        public Info virtualize()
      • virtualize

        public Info virtualize​(boolean virtualize)
      • cppText

        public Info cppText​(String cppText)
      • javaText

        public Info javaText​(String javaText)