Commit a7e54e76 authored by Sergey Galin's avatar Sergey Galin

QJniClass::callStaticParamLong

parent a0fcccc4
......@@ -750,6 +750,33 @@ jint QJniClass::callStaticParamInt(const char * method_name, const char * param_
}
jlong QJniClass::callStaticParamLong(const char * method_name, const char * param_signature, ...)
{
VERBOSE(qWarning("void QJniClass(%p)::CallStaticParamLong(\"%s\", \"%s\", ...)", reinterpret_cast<void*>(this), method_name, param_signature));
va_list args;
QJniEnvPtr jep;
JNIEnv* env = jep.env();
QByteArray signature("(");
signature += param_signature;
signature += ")J";
jmethodID mid = env->GetStaticMethodID(checkedClass(__FUNCTION__), method_name, signature.data());
if (!mid)
{
throw QJniMethodNotFoundException(debugClassName().constData(), method_name, __FUNCTION__);
}
va_start(args, param_signature);
jlong result = env->CallStaticLongMethodV(jClass(), mid, args);
va_end(args);
if (jep.clearException())
{
throw QJniJavaCallException(debugClassName().constData(), method_name, __FUNCTION__);
}
return result;
}
jfloat QJniClass::callStaticParamFloat(const char * method_name, const char * param_signature, ...)
{
VERBOSE(qWarning("void QJniClass(%p)::CallStaticParamFloat(\"%s\", \"%s\", ...)", reinterpret_cast<void*>(this), method_name, param_signature));
......
......@@ -224,6 +224,7 @@ public:
void callStaticParamVoid(const char * method_name, const char * param_signature, ...);
bool callStaticParamBoolean(const char * method_name, const char * param_signature, ...);
jint callStaticParamInt(const char * method_name, const char * param_signature, ...);
jlong callStaticParamLong(const char * method_name, const char * param_signature, ...);
jfloat callStaticParamFloat(const char * method_name, const char * param_signature, ...);
QString callStaticParamString(const char * method_name, const char * param_signature, ...);
void callStaticVoid(const char * method_name, const QString & string);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment