本文整理汇总了C++中JNIEnv::CallCharMethodA方法的典型用法代码示例。如果您正苦于以下问题:C++ JNIEnv::CallCharMethodA方法的具体用法?C++ JNIEnv::CallCharMethodA怎么用?C++ JNIEnv::CallCharMethodA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JNIEnv
的用法示例。
在下文中一共展示了JNIEnv::CallCharMethodA方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CallMember
value CallMember(jobject inObject, value inArgs)
{
JNIEnv *env = GetEnv();
jvalue jargs[MAX];
if (!HaxeToJNIArgs(env,inArgs,jargs))
{
CleanStringArgs();
ELOG("CallMember - bad argument list");
return alloc_null();
}
value result = 0;
switch(mReturn)
{
case jniVoid:
result = alloc_null();
env->CallVoidMethodA(inObject, mMethod, jargs);
break;
case jniObject:
result = JObjectToHaxe(env->CallObjectMethodA(inObject,mMethod, jargs));
break;
case jniObjectString:
result = JStringToHaxe(env,env->CallObjectMethodA(inObject, mMethod, jargs));
break;
case jniObjectArray:
result = JArrayToHaxe(env->CallObjectMethodA(inObject, mMethod, jargs));
break;
case jniBoolean:
result = alloc_bool(env->CallBooleanMethodA(inObject, mMethod, jargs));
break;
case jniByte:
result = alloc_int(env->CallByteMethodA(inObject, mMethod, jargs));
break;
case jniChar:
result = alloc_int(env->CallCharMethodA(inObject, mMethod, jargs));
break;
case jniShort:
result = alloc_int(env->CallShortMethodA(inObject, mMethod, jargs));
break;
case jniInt:
result = alloc_int(env->CallIntMethodA(mClass, mMethod, jargs));
break;
case jniLong:
result = alloc_int(env->CallLongMethodA(inObject, mMethod, jargs));
break;
case jniFloat:
result = alloc_float(env->CallFloatMethodA(inObject, mMethod, jargs));
break;
case jniDouble:
result = alloc_float(env->CallDoubleMethodA(inObject, mMethod, jargs));
break;
}
CleanStringArgs();
return result;
}
示例2: _call_method
//.........这里部分代码省略.........
case ARG_TYPE_VOID: {
if (method->_static) {
env->CallStaticVoidMethodA(_class,method->method,argv);
} else {
env->CallVoidMethodA(p_instance->instance,method->method,argv);
}
ret=Variant();
}
break;
case ARG_TYPE_BOOLEAN: {
if (method->_static) {
ret=env->CallStaticBooleanMethodA(_class,method->method,argv);
} else {
ret=env->CallBooleanMethodA(p_instance->instance,method->method,argv);
}
}
break;
case ARG_TYPE_BYTE: {
if (method->_static) {
ret=env->CallStaticByteMethodA(_class,method->method,argv);
} else {
ret=env->CallByteMethodA(p_instance->instance,method->method,argv);
}
}
break;
case ARG_TYPE_CHAR: {
if (method->_static) {
ret=env->CallStaticCharMethodA(_class,method->method,argv);
} else {
ret=env->CallCharMethodA(p_instance->instance,method->method,argv);
}
}
break;
case ARG_TYPE_SHORT: {
if (method->_static) {
ret=env->CallStaticShortMethodA(_class,method->method,argv);
} else {
ret=env->CallShortMethodA(p_instance->instance,method->method,argv);
}
}
break;
case ARG_TYPE_INT: {
if (method->_static) {
ret=env->CallStaticIntMethodA(_class,method->method,argv);
} else {
ret=env->CallIntMethodA(p_instance->instance,method->method,argv);
}
}
break;
case ARG_TYPE_LONG: {
if (method->_static) {
ret=env->CallStaticLongMethodA(_class,method->method,argv);
} else {
ret=env->CallLongMethodA(p_instance->instance,method->method,argv);
}
}
示例3: methodSig
//.........这里部分代码省略.........
retval.b = env->CallByteMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_I16:
case nsXPTType::T_U8:
retval.s = env->CallShortMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_I32:
case nsXPTType::T_U16:
retval.i = env->CallIntMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_I64:
case nsXPTType::T_U32:
retval.j = env->CallLongMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_FLOAT:
retval.f = env->CallFloatMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_U64:
case nsXPTType::T_DOUBLE:
retval.d = env->CallDoubleMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_BOOL:
retval.z = env->CallBooleanMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_CHAR:
case nsXPTType::T_WCHAR:
retval.c = env->CallCharMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_CHAR_STR:
case nsXPTType::T_WCHAR_STR:
case nsXPTType::T_IID:
case nsXPTType::T_ASTRING:
case nsXPTType::T_DOMSTRING:
case nsXPTType::T_UTF8STRING:
case nsXPTType::T_CSTRING:
case nsXPTType::T_INTERFACE:
case nsXPTType::T_INTERFACE_IS:
retval.l = env->CallObjectMethodA(javaObject, mid, java_params);
break;
case nsXPTType::T_VOID:
retval.j = env->CallLongMethodA(javaObject, mid, java_params);
break;
default:
NS_WARNING("Unhandled retval type");
break;
}
}
// Check for exception from called Java function
jthrowable exp = env->ExceptionOccurred();
if (exp) {
// If the exception is an instance of XPCOMException, then get the
// nsresult from the exception instance. Else, default to
// NS_ERROR_FAILURE.
if (env->IsInstanceOf(exp, xpcomExceptionClass)) {
jfieldID fid;