Skip to content

Commit

Permalink
Support VT_DATE getting from SafeArray
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykachalov committed Nov 1, 2018
1 parent eeb3396 commit 8c5ebe7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jacob/jni/SafeArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3173,5 +3173,16 @@ JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBoolean___3IZ
env->ReleaseIntArrayElements(indices, jIndices, NULL);
}

/*
* Class: SafeArray
* Method: getDate
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_SafeArray_getDate__I
(JNIEnv *env, jobject _this, jint idx)
{
GET1DCODE(VT_DATE, V_DATE, jdouble)
}


}
8 changes: 8 additions & 0 deletions jacob/jni/SafeArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,14 @@ JNIEXPORT jboolean JNICALL Java_com_jacob_com_SafeArray_getBoolean___3I
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBoolean___3IZ
(JNIEnv *, jobject, jintArray, jboolean);

/*
* Class: com_jacob_com_SafeArray
* Method: getDate
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_SafeArray_getDate__I
(JNIEnv *, jobject, jint);

#ifdef __cplusplus
}
#endif
Expand Down
9 changes: 9 additions & 0 deletions jacob/src/com/jacob/com/SafeArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,15 @@ public native void setStrings(int sa_idx, int nelems, String ja[],
*/
public native void setVariant(int indices[], Variant v);

/**
* get date from an single dimensional array
*
* @param sa_idx
* array index
* @return date stored in array
*/
public native double getDate(int sa_idx);

/**
* variant access
*
Expand Down

0 comments on commit 8c5ebe7

Please sign in to comment.