Swig:将返回类型std :: string转换为java byte [] [英] Swig: convert return type std::string to java byte[]

查看:449
本文介绍了Swig:将返回类型std :: string转换为java byte []的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++方法,返回一个std :: string。我使用SWIG,我想添加逻辑SWIG使得返回的std :: string在Java中作为byte []接收。

I have a C++ method that returns a std::string. I am using SWIG and I want to add logic to SWIG to make the std::string that is returned, be received in Java as a byte[].

如果这个

感谢

推荐答案

SWIG自带了许多C ++结构的预编写接口文件。在SWIG的lib目录中找到许多语言,包括Java。

SWIG comes with pre-written interface files for many C++ constructs. The are found in SWIG's Lib directory for many languages, including Java.

添加%include< std_string.i> 在您的SWIG界面文件中。检查SWIG的Lib / Java目录以支持其他结构。

Add %include <std_string.i> in your SWIG interface file. Check SWIG's Lib/Java directory for support for other constructs as well.

这篇关于Swig:将返回类型std :: string转换为java byte []的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆