javacpp
javacpp copied to clipboard
Problem with vector of nested class
trafficstars
Here's a demo
#include <vector>
class Out {
public:
class Inner {
public:
};
};
infoMap.put(new Info("std::vector<Out::Inner>").pointerTypes("InnerVector").define());
Here is InnerVector.java generated
@Name("std::vector<Out::Inner>") @Properties(inherit = ...)
public class InnerVector extends Pointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public InnerVector(Pointer p) { super(p); }
public InnerVector(Inner value) { this(1); put(0, value); }
public InnerVector(Inner ... array) { this(array.length); put(array); }
Inner in generated code should be changed to Out.Inner
Error messages
cannot find symbol
[ERROR] symbol: class Inner
At the moment, we need to provide Info for "special" types like that when used with templates, in this case, like this:
infoMap.put(new Info("Out::Inner").pointerTypes("Out.Inner");
Works for me. Thanks a lot @saudet !