Swig: convert return type std :: string to java byte []

I have a C ++ method that returns std :: string. I use SWIG and I want to add logic to SWIG to return std :: string, get in Java as byte [].

If possible, how can I do this?

thank

+1
source share
2 answers

SWIG comes with pre-written interface files for many C ++ constructs. They are located in the SWIG Lib directory for many languages, including Java.

Add %include <std_string.i>a SWIG to the interface file. Check the SWIG Lib / Java directory for support for other constructs.

+2
source

std::string - c_str, . , -, c.

0

All Articles