Awesome Open Source
Awesome Open Source

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.32.tar.gz"
  URL_HASH SHA256=e6937c95d73188a5add846b27cd00160fe4f6ea31af33be417d2ab7ac19bd8d2
)
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:🔗: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:🔗: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.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,147,256
Java (698,605
C Plus Plus (370,805
C Sharp (277,507
Objective C (108,098
Swift (94,970
Cpp (16,467
Language (3,589
Cross Platform (3,382
Cpp17 (1,853
Cpp11 (1,695
Cpp14 (956
Cpp Library (551
Idl (528
Bridge (508
Automatic (433
Jni (371
Automated (308
Bind (137
Jni Android (60
Jni Wrapper (26
Related Projects