|
JNIpp 1.0
JNI meets C++
|
Contains Java Native Interface functions; see jni for more. More...
Classes | |
| class | jni::AbstractObject |
Abstract Java object (jobject) container. More... | |
| class | jni::LObject |
| Wrapper for local Java objects. More... | |
| class | jni::VarArgs |
| Information about vararg support in jni functions. More... | |
Namespaces | |
| namespace | jni |
Contains Java Native Interface functions. | |
Enumerations | |
| enum | jni::ArrayReleaseMode { jni::CommitFreeElements, jni::CommitElements, jni::FreeElements } |
| Release mode for ReleaseXXXArrayElements functions. More... | |
Functions | |
| JNIEnv * | jni::GetEnv () |
Returns JNIEnv* for the current thread. | |
| void | jni::Initialize (JavaVM *vm) |
| Initializes jni; must be called before any other jni function. | |
| void | jni::Initialize (JNIEnv *env) |
Version of Initialize(JavaVM*) that takes JNIEnv*. | |
| void | jni::FatalError (const char *message,...) |
| Terminates current program with a message. | |
| LObject | jni::FindClass (const char *name) |
| Finds class by name. | |
| LObject | jni::GetObjectClass (const AbstractObject &object) |
Returns class of the object. | |
| LObject | jni::GetSuperclass (const AbstractObject &clazz) |
Returns superclass of the clazz. | |
| bool | jni::IsAssignableFrom (const AbstractObject &clazz, const AbstractObject &clazzFrom) |
Returns true if object of type clazz can be safely cast to clazzFrom. | |
| bool | jni::IsInstanceOf (const AbstractObject &object, const AbstractObject &clazz) |
Returns true if object is an instance of clazz. | |
| bool | jni::IsSameObject (const AbstractObject &object1, const AbstractObject &object2) |
| Tests whether two references refer to the same Java object. | |
| void | jni::Throw (const AbstractObject &throwable) |
| Raises Java exception. | |
| void | jni::TranslateJavaException () |
| Converts currently pending Java exception to C++ exception. | |
| void | jni::TranslateCppException () |
| Converts current C++ exception to the Java exception and raises it using jni::Throw(). | |
| jsize | jni::GetArrayLength (const AbstractObject &array) |
| Returns array's length. | |
| LObject | jni::NewObjectArray (jsize length, const AbstractObject &elementClass) |
| Creates new object array and fills it with nulls. | |
| LObject | jni::NewObjectArray (jsize length, const AbstractObject &elementClass, const AbstractObject &initialElement) |
Creates new object array of objects and fills it with initialElement. | |
| LObject | jni::GetObjectArrayElement (const AbstractObject &array, jsize index) |
| Retrieves object array element. | |
| void | jni::SetObjectArrayElement (const AbstractObject &array, jsize index, const AbstractObject &value) |
| Sets object array element. | |
| LObject | jni::NewBoolArray (jsize length) |
Creates new boolean array; equivalent to jni::NewBooleanArray(). | |
| bool * | jni::GetBoolArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks boolean array elements. | |
| void | jni::ReleaseBoolArrayElements (const AbstractObject &array, bool *elements, jint mode) |
Releases (and optionally commits) boolean array elements. | |
| void | jni::GetBoolArrayRegion (const AbstractObject &array, jsize start, jsize length, bool *buffer) |
Retrieves region from boolean array. | |
| void | jni::SetBoolArrayRegion (const AbstractObject &array, jsize start, jsize length, const bool *buffer) |
Updates region in boolean array. | |
| LObject | jni::NewBooleanArray (jsize length) |
Creates new boolean array. | |
| jboolean * | jni::GetBooleanArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks boolean array elements; see also jni::GetBoolArrayElements(). | |
| void | jni::ReleaseBooleanArrayElements (const AbstractObject &array, jboolean *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) boolean array elements; see also jni::ReleaseBoolArrayElements(). | |
| void | jni::GetBooleanArrayRegion (const AbstractObject &array, jsize start, jsize length, jboolean *buffer) |
Retrieves region from boolean array; see also jni::GetBoolArrayRegion(). | |
| void | jni::SetBooleanArrayRegion (const AbstractObject &array, jsize start, jsize length, const jboolean *buffer) |
Updates region in boolean array; see also jni::SetBoolArrayRegion(). | |
| LObject | jni::NewByteArray (jsize length) |
Creates new byte array. | |
| jbyte * | jni::GetByteArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks byte array elements. | |
| void | jni::ReleaseByteArrayElements (const AbstractObject &array, jbyte *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) byte array elements. | |
| void | jni::GetByteArrayRegion (const AbstractObject &array, jsize start, jsize length, jbyte *buffer) |
Retrieves region from byte array. | |
| void | jni::SetByteArrayRegion (const AbstractObject &array, jsize start, jsize length, const jbyte *buffer) |
Updates region in byte array. | |
| LObject | jni::NewCharArray (jsize length) |
Creates new char array. | |
| jchar * | jni::GetCharArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks char array elements. | |
| void | jni::ReleaseCharArrayElements (const AbstractObject &array, jchar *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) char array elements. | |
| void | jni::GetCharArrayRegion (const AbstractObject &array, jsize start, jsize length, jchar *buffer) |
Retrieves region from char array. | |
| void | jni::SetCharArrayRegion (const AbstractObject &array, jsize start, jsize length, const jchar *buffer) |
Updates region in char array. | |
| LObject | jni::NewShortArray (jsize length) |
Creates new short array. | |
| jshort * | jni::GetShortArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks short array elements. | |
| void | jni::ReleaseShortArrayElements (const AbstractObject &array, jshort *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) short array elements. | |
| void | jni::GetShortArrayRegion (const AbstractObject &array, jsize start, jsize length, jshort *buffer) |
Retrieves region from short array. | |
| void | jni::SetShortArrayRegion (const AbstractObject &array, jsize start, jsize length, const jshort *buffer) |
Updates region in short array. | |
| LObject | jni::NewIntArray (jsize length) |
Creates new int array. | |
| jint * | jni::GetIntArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks int array elements. | |
| void | jni::ReleaseIntArrayElements (const AbstractObject &array, jint *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) int array elements. | |
| void | jni::GetIntArrayRegion (const AbstractObject &array, jsize start, jsize length, jint *buffer) |
Retrieves region from int array. | |
| void | jni::SetIntArrayRegion (const AbstractObject &array, jsize start, jsize length, const jint *buffer) |
Updates region in int array. | |
| LObject | jni::NewLongArray (jsize length) |
Creates new long array. | |
| jlong * | jni::GetLongArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks long array elements. | |
| void | jni::ReleaseLongArrayElements (const AbstractObject &array, jlong *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) long array elements. | |
| void | jni::GetLongArrayRegion (const AbstractObject &array, jsize start, jsize length, jlong *buffer) |
Retrieves region from long array. | |
| void | jni::SetLongArrayRegion (const AbstractObject &array, jsize start, jsize length, const jlong *buffer) |
Updates region in long array. | |
| LObject | jni::NewFloatArray (jsize length) |
Creates new float array. | |
| jfloat * | jni::GetFloatArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks float array elements. | |
| void | jni::ReleaseFloatArrayElements (const AbstractObject &array, jfloat *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) float array elements. | |
| void | jni::GetFloatArrayRegion (const AbstractObject &array, jsize start, jsize length, jfloat *buffer) |
Retrieves region from float array. | |
| void | jni::SetFloatArrayRegion (const AbstractObject &array, jsize start, jsize length, const jfloat *buffer) |
Updates region in float array. | |
| LObject | jni::NewDoubleArray (jsize length) |
Creates new double array. | |
| jdouble * | jni::GetDoubleArrayElements (const AbstractObject &array, bool *isCopy=0) |
Retrieves and locks double array elements. | |
| void | jni::ReleaseDoubleArrayElements (const AbstractObject &array, jdouble *elements, ArrayReleaseMode mode) |
Releases (and optionally commits) double array elements. | |
| void | jni::GetDoubleArrayRegion (const AbstractObject &array, jsize start, jsize length, jdouble *buffer) |
Retrieves region from double array. | |
| void | jni::SetDoubleArrayRegion (const AbstractObject &array, jsize start, jsize length, const jdouble *buffer) |
Updates region in double array. | |
| jmethodID | jni::GetMethodID (const AbstractObject &clazz, const char *name, const char *signature) |
| Finds method in the class. | |
| jmethodID | jni::GetStaticMethodID (const AbstractObject &clazz, const char *name, const char *signature) |
| Finds static method in the class. | |
| LObject | jni::NewObject (const AbstractObject &clazz, jmethodID constructorID, VarArgs) |
Create new Java object (equivalent to new in Java). | |
| void | jni::CallVoidMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls void method. | |
| LObject | jni::CallObjectMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
| Calls method returning object. | |
| jboolean | jni::CallBooleanMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning boolean; see also CallBoolMethod(). | |
| bool | jni::CallBoolMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning boolean and converts result to C++ bool. | |
| jbyte | jni::CallByteMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning byte. | |
| jchar | jni::CallCharMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning char. | |
| jshort | jni::CallShortMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning short. | |
| jint | jni::CallIntMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning int. | |
| jlong | jni::CallLongMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning long. | |
| jfloat | jni::CallFloatMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning float. | |
| jdouble | jni::CallDoubleMethod (const AbstractObject &object, jmethodID methodID, VarArgs) |
Calls method returning double. | |
| void | jni::CallNonvirtualVoidMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls void method defined in clazz. | |
| LObject | jni::CallNonvirtualObjectMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning object defined in clazz. | |
| jboolean | jni::CallNonvirtualBooleanMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning boolean; see also CallNonvirtualBoolMethod(). | |
| bool | jni::CallNonvirtualBoolMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning boolean defined in clazz and converts result to C++ bool. | |
| jbyte | jni::CallNonvirtualByteMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning byte defined in clazz. | |
| jchar | jni::CallNonvirtualCharMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning char defined in clazz. | |
| jshort | jni::CallNonvirtualShortMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning short defined in clazz. | |
| jint | jni::CallNonvirtualIntMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning int defined in clazz. | |
| jlong | jni::CallNonvirtualLongMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning long defined in clazz. | |
| jfloat | jni::CallNonvirtualFloatMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning float defined in clazz. | |
| jdouble | jni::CallNonvirtualDoubleMethod (const AbstractObject &object, const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls method returning double defined in clazz. | |
| void | jni::CallStaticVoidMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
| Calls void static method. | |
| jobject | jni::CallStaticObjectMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
| Calls static method returning object. | |
| jboolean | jni::CallStaticBooleanMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning boolean; see also CallStaticBoolMethod(). | |
| bool | jni::CallStaticBoolMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning boolean and converts result to C++ bool. | |
| jbyte | jni::CallStaticByteMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning byte. | |
| jchar | jni::CallStaticCharMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning char. | |
| jshort | jni::CallStaticShortMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning short. | |
| jint | jni::CallStaticIntMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning int. | |
| jlong | jni::CallStaticLongMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning long. | |
| jfloat | jni::CallStaticFloatMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning float. | |
| jdouble | jni::CallStaticDoubleMethod (const AbstractObject &clazz, jmethodID methodID, VarArgs) |
Calls static method returning double. | |
| jfieldID | jni::GetFieldID (const AbstractObject &clazz, const char *name, const char *signature) |
| Returns id of the field. | |
| jfieldID | jni::GetStaticFieldID (const AbstractObject &clazz, const char *name, const char *signature) |
| Returns id of the static field. | |
| LObject | jni::GetObjectField (const AbstractObject &object, jfieldID fieldID) |
| Retrieves value of an object field. | |
| void | jni::SetObjectField (const AbstractObject &object, jfieldID fieldID, const AbstractObject &value) |
| Sets value to an object field. | |
| jboolean | jni::GetBooleanField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a boolean field; see also GetBoolField(). | |
| void | jni::SetBooleanField (const AbstractObject &object, jfieldID fieldID, jboolean value) |
Sets value to a boolean field; see also SetBoolField(). | |
| bool | jni::GetBoolField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a boolean field and converts it to C++ bool. | |
| void | jni::SetBoolField (const AbstractObject &object, jfieldID fieldID, bool value) |
Sets value of a C++ bool to a boolean field. | |
| jbyte | jni::GetByteField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a byte field. | |
| void | jni::SetByteField (const AbstractObject &object, jfieldID fieldID, jbyte value) |
Sets value to a byte field. | |
| jchar | jni::GetCharField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a char field. | |
| void | jni::SetCharField (const AbstractObject &object, jfieldID fieldID, jchar value) |
Sets value to a char field. | |
| jshort | jni::GetShortField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a short field. | |
| void | jni::SetShortField (const AbstractObject &object, jfieldID fieldID, jshort value) |
Sets value to a short field. | |
| jint | jni::GetIntField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a int field. | |
| void | jni::SetIntField (const AbstractObject &object, jfieldID fieldID, jint value) |
Sets value to a int field. | |
| jlong | jni::GetLongField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a long field. | |
| void | jni::SetLongField (const AbstractObject &object, jfieldID fieldID, jlong value) |
Sets value to a long field. | |
| jfloat | jni::GetFloatField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a float field. | |
| void | jni::SetFloatField (const AbstractObject &object, jfieldID fieldID, jfloat value) |
Sets value to a float field. | |
| jdouble | jni::GetDoubleField (const AbstractObject &object, jfieldID fieldID) |
Retrieves value of a double field. | |
| void | jni::SetDoubleField (const AbstractObject &object, jfieldID fieldID, jdouble value) |
Sets value to a double field. | |
| LObject | jni::GetStaticObjectField (const AbstractObject &clazz, jfieldID fieldID) |
| Retrieves value of a static object field. | |
| void | jni::SetStaticObjectField (const AbstractObject &clazz, jfieldID fieldID, const AbstractObject &value) |
| Sets value to a static object field. | |
| jboolean | jni::GetStaticBooleanField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a boolean field; see also GetStaticBoolField. | |
| void | jni::SetStaticBooleanField (const AbstractObject &clazz, jfieldID fieldID, jboolean value) |
Sets value to a static boolean field; see also SetStaticBoolField. | |
| bool | jni::GetStaticBoolField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a boolean field and converts it to C++ bool. | |
| void | jni::SetStaticBoolField (const AbstractObject &clazz, jfieldID fieldID, bool value) |
Sets value of a C++ bool to a static boolean field. | |
| jbyte | jni::GetStaticByteField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static byte field. | |
| void | jni::SetStaticByteField (const AbstractObject &clazz, jfieldID fieldID, jbyte value) |
Sets value to a static byte field. | |
| jchar | jni::GetStaticCharField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static char field. | |
| void | jni::SetStaticCharField (const AbstractObject &clazz, jfieldID fieldID, jchar value) |
Sets value to a static char field. | |
| jshort | jni::GetStaticShortField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static short field. | |
| void | jni::SetStaticShortField (const AbstractObject &clazz, jfieldID fieldID, jshort value) |
Sets value to a static short field. | |
| jint | jni::GetStaticIntField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static int field. | |
| void | jni::SetStaticIntField (const AbstractObject &clazz, jfieldID fieldID, jint value) |
Sets value to a static int field. | |
| jlong | jni::GetStaticLongField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static long field. | |
| void | jni::SetStaticLongField (const AbstractObject &clazz, jfieldID fieldID, jlong value) |
Sets value to a static long field. | |
| jfloat | jni::GetStaticFloatField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static float field. | |
| void | jni::SetStaticFloatField (const AbstractObject &clazz, jfieldID fieldID, jfloat value) |
Sets value to a static float field. | |
| jdouble | jni::GetStaticDoubleField (const AbstractObject &clazz, jfieldID fieldID) |
Retrieves value of a static double field. | |
| void | jni::SetStaticDoubleField (const AbstractObject &clazz, jfieldID fieldID, jdouble value) |
Sets value to a static double field. | |
Variables | |
| LObject | jni::NullObject |
| Pass this object instead of NULL. | |
| const bool | jni::JBooleanIsBool |
Indicates whether an array of jboolean values can be cast to an array of C++ bool values. | |
Contains Java Native Interface functions; see jni for more.