1 Star 0 Fork 0

damone / scapix

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Scapix Language Bridge

Tweet

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.

Scapix Bridge Intro

Integrating in CMake project

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"
)

Documentation

Examples:

Java Link

Modern C++17 wrapper for JNI:

  • type-safe APIs
  • automatic resource management
  • ZERO runtime overhead compared to manually written JNI code
  • automatic C++/Java type conversion for many standard types (std::string, std::vector, etc.)
  • automatic C++/Java exception tunneling
  • comes with pre-generated C++ headers for all JDK and Android Java APIs
  • automatically generate C++ headers for any Java code, including your own
#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

License

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.

空文件

简介

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 ma 展开 收起
C++ 等 4 种语言
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/damone/scapix.git
git@gitee.com:damone/scapix.git
damone
scapix
scapix
master

搜索帮助