📄 propertyjni.cpp
字号:
* Signature: (I)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_IntProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jint iValue ){ try { IntProperty * TheIntProperty = (IntProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheIntProperty->SetValue( iValue ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("IntProperty"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- UIntProperty ------------------/* * Class: com_intel_mobile_base_UIntProperty * Method: GetValueNative * Signature: ()I */JNIEXPORT jint JNICALL Java_com_intel_mobile_base_UIntProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject ){ try { UIntProperty * TheUIntProperty = (UIntProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheUIntProperty->GetValue(); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("UIntProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_UIntProperty * Method: SetValueNative * Signature: (I)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_UIntProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jint iValue ){ try { UIntProperty * TheUIntProperty = (UIntProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheUIntProperty->SetValue( iValue ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("UIntProperty"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- Int64Property ------------------/* * Class: com_intel_mobile_base_Int64Property * Method: GetValueNative * Signature: ()J */JNIEXPORT jlong JNICALL Java_com_intel_mobile_base_Int64Property_GetValueNative( JNIEnv *JniEnv, jobject JObject ){ try { Int64Property * TheInt64Property = (Int64Property *) Get_nativeObjRef( JniEnv, JObject ); return TheInt64Property->GetValue(); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("Int64Property"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_Int64Property * Method: SetValueNative * Signature: (J)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_Int64Property_SetValueNative( JNIEnv *JniEnv, jobject JObject, jlong lValue ){ try { Int64Property * TheInt64Property = (Int64Property *) Get_nativeObjRef( JniEnv, JObject ); return TheInt64Property->SetValue( lValue ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("Int64Property"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- UInt64Property ------------------/* * Class: com_intel_mobile_base_UInt64Property * Method: GetValueNative * Signature: ()J */JNIEXPORT jlong JNICALL Java_com_intel_mobile_base_UInt64Property_GetValueNative( JNIEnv *JniEnv, jobject JObject ){ try { UInt64Property * TheUInt64Property = (UInt64Property *) Get_nativeObjRef( JniEnv, JObject ); return TheUInt64Property->GetValue(); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("UInt64Property"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_UInt64Property * Method: SetValueNative * Signature: (J)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_UInt64Property_SetValueNative( JNIEnv *JniEnv, jobject JObject, jlong lValue ){ try { UInt64Property * TheUInt64Property = (UInt64Property *) Get_nativeObjRef( JniEnv, JObject ); return TheUInt64Property->SetValue( lValue ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("UInt64Property"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- FloatProperty ------------------/* * Class: com_intel_mobile_base_FloatProperty * Method: GetValueNative * Signature: ()F */JNIEXPORT jfloat JNICALL Java_com_intel_mobile_base_FloatProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject ){ try { FloatProperty * TheFloatProperty = (FloatProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheFloatProperty->GetValue(); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("FloatProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_FloatProperty * Method: SetValueNative * Signature: (F)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_FloatProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jfloat fValue ){ try { FloatProperty * TheFloatProperty = (FloatProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheFloatProperty->SetValue( fValue ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("FloatProperty"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- DateTimeProperty ------------------/* * Class: com_intel_mobile_base_DateTimeProperty * Method: GetValueNative * Signature: ()Ljava/util/Date; */JNIEXPORT jobject JNICALL Java_com_intel_mobile_base_DateTimeProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject ){ try { DateTimeProperty * TheDateTimeProperty = (DateTimeProperty *) Get_nativeObjRef( JniEnv, JObject ); return DATE2jobject( JniEnv, TheDateTimeProperty->GetValue() ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("DateTimeProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_DateTimeProperty * Method: SetValueNative * Signature: (IIIIII)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_DateTimeProperty_SetValueNative ( JNIEnv *JniEnv, jobject JObject, jint nYear, jint nMonth, jint nDay, jint nHour, jint nMin, jint nSec ){ try { DateTimeProperty * TheDateTimeProperty = (DateTimeProperty *) Get_nativeObjRef( JniEnv, JObject ); // COleDateTime dt( nYear, nMonth+1, nDay, nHour, nMin, nSec ); //return TheDateTimeProperty->SetValue( dt.m_dt ); struct timeval tv; gettimeofday(&tv, NULL); return TheDateTimeProperty->SetValue( tv.tv_sec ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("DateTimeProperty"), IntelMobileText("SetValue()") ); } return NULL;}// --------------------------------------------------------// ----------------- StringArrayProperty ------------------/* * Class: com_intel_mobile_base_StringArrayProperty * Method: GetValueNative * Signature: (I)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_com_intel_mobile_base_StringArrayProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset ){ try { StringArrayProperty * TheStringArrayProperty = (StringArrayProperty *) Get_nativeObjRef( JniEnv, JObject ); IntelMobileChar * pWChar = TheStringArrayProperty->GetValue( Offset ); jstring result = BSTR2jstring( JniEnv, pWChar ); delete [] pWChar; return result; } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("StringArrayProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_StringArrayProperty * Method: SetValueNative * Signature: (ILjava/lang/String;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_StringArrayProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset, jstring sValue ){ try { StringArrayProperty * TheStringArrayProperty = (StringArrayProperty *) Get_nativeObjRef( JniEnv, JObject ); IntelMobileChar * pWChar = jstring2BSTR( JniEnv, sValue ); jboolean result = TheStringArrayProperty->SetValue( Offset, pWChar ); //SysFreeString( pWChar ); return result; } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("StringArrayProperty"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- BoolArrayProperty ------------------/* * Class: com_intel_mobile_base_BoolArrayProperty * Method: GetValueNative * Signature: (I)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_BoolArrayProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset ){ try { BoolArrayProperty * TheBoolArrayProperty = (BoolArrayProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheBoolArrayProperty->GetValue( Offset ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("BoolArrayProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_BoolArrayProperty * Method: SetValueNative * Signature: (IZ)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_BoolArrayProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset, jboolean bValue ){ try { BoolArrayProperty * TheBoolArrayProperty = (BoolArrayProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheBoolArrayProperty->SetValue( Offset, (bValue ? true : false) ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("BoolArrayProperty"), IntelMobileText("SetValue()") ); } return NULL;}// ----------------- ByteArrayProperty ------------------/* * Class: com_intel_mobile_base_ByteArrayProperty * Method: GetValueNative * Signature: (I)B */JNIEXPORT jbyte JNICALL Java_com_intel_mobile_base_ByteArrayProperty_GetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset ){ try { ByteArrayProperty * TheByteArrayProperty = (ByteArrayProperty *) Get_nativeObjRef( JniEnv, JObject ); return TheByteArrayProperty->GetValue( Offset ); } catch (IntelMobileException Ex) { ThrowException( JniEnv, Ex ); } catch (...) { ThrowUnknownException( JniEnv, IntelMobileText("ByteArrayProperty"), IntelMobileText("GetValue()") ); } return NULL;}/* * Class: com_intel_mobile_base_ByteArrayProperty * Method: SetValueNative * Signature: (IB)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_base_ByteArrayProperty_SetValueNative( JNIEnv *JniEnv, jobject JObject, jint Offset, jbyte cValue ){ try {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -