Closed GoogleCodeExporter closed 9 years ago
Correct, it wasn't doing what one would expect from it. I think I've fixed that
with this change:
http://code.google.com/p/javacpp/source/detail?r=2b3ce614120d0b813dd83901294e006
4b62f97cb
Let me know how that goes, and thanks for reporting!
Original comment by samuel.a...@gmail.com
on 7 Jul 2013 at 1:15
This almost works for me, but it now generates a "std::string&" even when
explicitly putting a @ByVal in.
Original comment by neoco...@googlemail.com
on 8 Jul 2013 at 7:13
We can adjust the type to whatever we want with the second cast (the first cast
gets applied to the `const char *` of the `String`, not the `StringAdapter`),
i.e.:
public void call(@Cast({"", "std::string"}) @StdString String key, @Cast({"",
"std::string"}) @StdString String value);
Original comment by samuel.a...@gmail.com
on 8 Jul 2013 at 7:41
Ah, thanks - that works great!
Original comment by neoco...@googlemail.com
on 8 Jul 2013 at 1:29
Good! BTW, it's also possible to create your own annotation and put the @Cast
there, i.e.: Copy StdString.java to MyStdString.java or something, change the
content of the @Cast annotation in the file, and use @MyStdString on parameters.
Original comment by samuel.a...@gmail.com
on 8 Jul 2013 at 1:51
Fix included in newly released version 0.6, thanks for reporting!
Original comment by samuel.a...@gmail.com
on 15 Sep 2013 at 1:32
Original issue reported on code.google.com by
neoco...@googlemail.com
on 5 Jul 2013 at 12:26