java4cpp

Utiliity to create C++ Wrapper for Java JAR library.

Лицензия

Лицензия

Группа

Группа

com.github.wshackle
Идентификатор

Идентификатор

java4cpp
Последняя версия

Последняя версия

1.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

java4cpp
Utiliity to create C++ Wrapper for Java JAR library.
Ссылка на сайт

Ссылка на сайт

https://github.com/wshackle/java4cpp
Система контроля версий

Система контроля версий

https://github.com/wshackle/java4cpp

Скачать java4cpp

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.wshackle/java4cpp/ -->
<dependency>
    <groupId>com.github.wshackle</groupId>
    <artifactId>java4cpp</artifactId>
    <version>1.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.wshackle/java4cpp/
implementation 'com.github.wshackle:java4cpp:1.5'
// https://jarcasting.com/artifacts/com.github.wshackle/java4cpp/
implementation ("com.github.wshackle:java4cpp:1.5")
'com.github.wshackle:java4cpp:jar:1.5'
<dependency org="com.github.wshackle" name="java4cpp" rev="1.5">
  <artifact name="java4cpp" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.wshackle', module='java4cpp', version='1.5')
)
libraryDependencies += "com.github.wshackle" % "java4cpp" % "1.5"
[com.github.wshackle/java4cpp "1.5"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.jooq : jool jar 0.9.6
commons-cli : commons-cli jar 1.3.1

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

Java 4 C++ (java4cpp)

A utility for creating C++ wrapper classes for a Java Library(.jar file) or class file.

Build

To build one needs:

Use the command:

mvn package

OR

  • An IDE bundled with both maven and a JDK such as Netbeans, IntelliJ, or Eclipse.
    • Netbeans will open a maven project with File -> Open Project just like Netbeans generated Ant projects.
    • IntelliJ and Eclipse both have options to import maven projects.

Run

Run directly with:

java -jar target/java4cpp-1.2-SNAPSHOT-jar-with-dependencies.jar

Possible options are:

 -?,--help              Print this message
 -c,--class <arg>       Single Java class to extract.
 -h,--header <arg>      Output C++ header file.
 -j,--jar <arg>         Input jar file
 -l,--limit <arg>       Maximum limit on classes to extract from
                        jars.[default=200]
 -n,--namespace <arg>   C++ namespace for newly generated classes.
 -o,--output <arg>      Output C++ source file.
 -p,--package <arg>     Java Package prefix to extract

Example

Given the following java class:

public class Simple {

    final int value;

    public Simple(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }
}

Compiled just with:

 javac Simple.java

C++ header and sources could be generated with:

java -jar ../../target/java4cpp-1.0-SNAPSHOT-jar-with-dependencies.jar -c Simple 

So that the C++ code to use the class could be just this:

#include "simple.h"
#include <iostream>

using namespace simple;
using namespace std;

int main(int argc, const  char **argv){

        Simple s(4);
        cout << "s.getValue() = " << s.getValue() << endl;

}

For complete compile and link instructions, Visual Studio Solution and Project files etc. see the examples/simple subdirectory. For more advanced options see the other examples directories( TO BE DEVELOPED ) and/or wiki (https://github.com/wshackle/java4cpp/wiki)

Build Status

Версии библиотеки

Версия
1.5
1.4
1.3
1.2
1.1