代码拉取完成,页面将自动刷新
Automatic, on the fly bindings from C++ to Java
, Objective-C
, Swift
, Python
, JavaScript
(WebAssembly) and C#
.
Bridge code automatically generated directly from C++ header files, no need to manually maintain IDL definitions or bindings.
include(FetchContent)
FetchContent_Declare(
cmodule
URL "https://github.com/scapix-com/cmodule/archive/refs/tags/v1.0.38.tar.gz"
URL_HASH SHA256=43973f0a347cee0d307fe094920e7bebb1ea5c93a16a06bacb49474b8b929efc
)
FetchContent_MakeAvailable(cmodule)
find_package(Scapix REQUIRED)
scapix_bridge_headers(
chatlib
"com.example.chat"
"source/chat/contact.h"
"source/chat/session.h"
"source/chat/model.h"
)
Examples:
Modern C++17 wrapper for JNI:
#include <scapix/java_api/java/lang/System.h>
#include <scapix/java_api/java/util/Locale.h>
#include <scapix/java_api/java/text/DateFormatSymbols.h>
using namespace scapix::link::java;
using namespace scapix::java_api;
void test()
{
// C++ objects are automatically converted to and from corresponding Java types.
// This works for any type supported by scapix::link::java::convert<> interface,
// which supports many STL types and can be extended for your own types.
std::string version = java::lang::System::getProperty("java.version");
std::vector<std::string> languages = java::util::Locale::getISOLanguages();
std::vector<std::vector<std::string>> zone_strings = java::text::DateFormatSymbols::getInstance()->getZoneStrings();
std::map<std::string, std::string> properties = java::lang::System::getProperties();
}
Java Link Documentation
Java Link Example
Please carefully read license agreement.
In short: If you comply with license agreement, you may use Scapix Language Bridge free of charge to build commercial and/or open source applications. You may NOT modify and/or redistribute the Scapix Language Bridge product itself.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。