コード例 #1
0
//-------------------------------------------------------
// Return the pointer to the subject (as an ICalParameter*) from the given surrogate.
// If the subject is not an ICalParameter type, or if the subject is NULL, then return NULL.
//-------------------------------------------------------
ICalParameter* getSubjectAsICalParameter(JNIEnv *env, jobject surrogateParameter, int exceptionType)
{
	ICalParameter* result = (ICalParameter*)(getCObjectPtr(env,surrogateParameter));

	if (result == NULL)
	{
        throwException( env, exceptionType );
	}

	return(result);
}
コード例 #2
0
//-------------------------------------------------------
// Return the pointer to the subject (as an ICalValue*) from the given surrogate.
// If the subject is not an ICalValue type, or if the subject is NULL, then return NULL.
//-------------------------------------------------------
ICalValue* getSubjectAsICalValue(JNIEnv *env, jobject surrogateValue, int exceptionType)
{
	ICalValue* result = (ICalValue*)(getCObjectPtr(env,surrogateValue));

	if (result == NULL)
	{
        throwException( env, exceptionType );
	}

	return(result);
}
コード例 #3
0
//-------------------------------------------------------
// Return the pointer to the subject (as an ICalProperty*) from the given surrogate.
// If the subject is not an ICalProperty type, or if the subject is NULL, then return NULL.
//-------------------------------------------------------
ICalProperty* getSubjectAsICalProperty(JNIEnv *env, jobject surrogateProperty, int exceptionType)
{
	ICalProperty* result = (ICalProperty*)(getCObjectPtr(env,surrogateProperty));

	if (result == NULL)
	{
        throwException(env, exceptionType );
	}

	return(result);
}
コード例 #4
0
//-------------------------------------------------------
// Return the pointer to the subject (as an VComponent*) from the given surrogate.
// If the subject is not an VComponent type, or if the subject is NULL, then return NULL.
//-------------------------------------------------------
VComponent* getSubjectAsVComponent(JNIEnv *env, jobject surrogateComponent, int exceptionType)
{
	VComponent* result = (VComponent*)(getCObjectPtr(env,surrogateComponent));

	if (result == NULL)
	{
        throwException(env, exceptionType );
	}

	return(result);
}
コード例 #5
0
/*
 * Class:     net_cp_jlibical_ICalProperty
 * Method:    isa_property
 * Signature: (Ljava/lang/Object;)I
 */
JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalProperty_isa_1property
  (JNIEnv *env, jobject jobj, jobject arg)
{
	jboolean result = 0;
	ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		void* argObjPtr = 0;

		if (arg != NULL)
		{
			argObjPtr = getCObjectPtr(env,arg);
		}

		// get the result from the c++ object (argObjPtr can be 0, it's cObj's responsibility to handle this if an error).
		result = cObj->isa_property(argObjPtr) != 0;
	}

	return(result);
}
コード例 #6
0
/*
 * Class:     net_cp_jlibical_ICalParameter
 * Method:    isa_parameter
 * Signature: (Ljava/lang/Object;)Z
 */
JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalParameter_isa_1parameter
  (JNIEnv *env, jobject jobj, jobject arg)
{
	jboolean result = 0;

	// get the c++ object from the jobj
	ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);
	if (cObj != NULL)
	{
		// get the c++ object from the arg
		void* argObjPtr = 0;

		if (arg != NULL)
		{
			argObjPtr = getCObjectPtr(env,arg);
		}

		// get the result from the c++ object (candidateValue can be 0, it's cObj's responsibility to handle this if an error).
		result = cObj->isa_parameter(argObjPtr) != 0;
	}

	return(result);
}
コード例 #7
0
/*
 * Class:     net_cp_jlibical_ICalValue
 * Method:    isa_value
 * Signature: (Ljava/lang/Object;)Z
 */
JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalValue_isa_1value
  (JNIEnv *env, jobject jobj, jobject arg)
{
	jboolean result = 0;

	// get the c++ object from the jobj
	ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);
	if (cObj != NULL)
	{
		// get the c++ object from arg
		void* argObjPtr = 0;

		if (arg != NULL)
		{
			argObjPtr = getCObjectPtr(env,jobj);
		}

		// get the result from the c++ object
		result = cObj->isa_value(argObjPtr) != 0;
	}

	return(result);
}