Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ install:
build_script:

# Build NIX Java bindings
- mvn clean package -DnixIncludePath=C:/projects/nix-java/nix/include -DboostIncludePath=%BOOST_INCLUDEDIR% -DnixLinkPath=C:/projects/nix-java/nix/build/Release -Dhdf5LinkPath=%HDF5_BASE%/bin -DboostLinkPath=%BOOST_ROOT%/lib -Dmaven.test.failure.ignore=true -Dplatform.dependency=false
- mvn clean package -DnixIncludePath=C:/projects/nix-java/nix/include -DboostIncludePath=%BOOST_INCLUDEDIR% -DnixLinkPath=C:/projects/nix-java/nix/build/Release -Dhdf5LinkPath=%HDF5_BASE%/bin -DboostLinkPath=%BOOST_ROOT%/lib -Dplatform.dependency=false

on_failure:

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.1</version>
<version>1.4.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -100,7 +100,7 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.1</version>
<version>1.4.4</version>
<configuration>
<properties>${platform.properties}</properties>
<classPath>${project.build.outputDirectory}</classPath>
Expand Down
40 changes: 5 additions & 35 deletions src/main/java/org/g_node/nix/Variant.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,70 +150,40 @@ public void setString(String value) {
// Getters
//--------------------------------------------------

private native void get(@Cast("bool*") @ByRef BoolPointer out);

/**
* Getter for boolean value.
*
* @return boolean data.
*/
public boolean getBoolean() {
BoolPointer bp = new BoolPointer(1);
get(bp);
return bp.get();
}

private native void get(@Cast("int32_t*") @ByRef IntPointer value);
public native @Cast("bool") @Name("get<bool>") boolean getBoolean();

/**
* Getter for 32 bit integer value.
*
* @return 32 bit integer data as int.
*/
public int getInt() {
IntPointer p = new IntPointer(1);
get(p);
return p.get();
}

private native void get(@Cast("int64_t*") @ByRef LongPointer value);
public native @Cast("int32_t") @Name("get<int32_t>") int getInt();

/**
* Getter for 64 bit integer value.
*
* @return 64 bit int in NIX as long.
*/
public long getLong() {
LongPointer p = new LongPointer(1);
get(p);
return p.get();
}

private native void get(@ByRef double[] value);
public native @Cast("int64_t") @Name("get<int64_t>") long getLong();

/**
* Getter for double value.
*
* @return double data.
*/
public double getDouble() {
double[] val = new double[1];
get(val);
return val[0];
}

private native void get(@StdString BytePointer value);
public native @Cast("double") @Name("get<double>") double getDouble();

/**
* Getter for string value.
*
* @return string data.
*/
public String getString() {
BytePointer bp = new BytePointer(1);
get(bp);
return bp.getString();
}
public native @StdString @Name("get<std::string>") String getString();

//--------------------------------------------------
// Other functions
Expand Down