/*
 * Class:     net_cp_jlibical_ICalParameter
 * Method:    set_partstat
 * Signature: (I)V
 */
JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1partstat
  (JNIEnv *env, jobject jobj, jint value)
{
	ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		cObj->set_partstat((icalparameter_partstat)value);
	}
}
/*
 * Class:     net_cp_jlibical_ICalParameter
 * Method:    isa
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_isa
  (JNIEnv *env, jobject jobj)
{
	jint result = 0;
	ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		result = cObj->isa();
	}

	return(result);
}
/*
 * Class:     net_cp_jlibical_ICalParameter
 * Method:    set_language
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1language
  (JNIEnv *env, jobject jobj, jstring str)
{
	ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		const char* szTemp = env->GetStringUTFChars(str,NULL);

		cObj->set_language((char*)szTemp);
		env->ReleaseStringUTFChars(str,szTemp);
	}
}
Exemplo n.º 4
0
/*
 * Class:     net_cp_jlibical_ICalProperty
 * Method:    set_parameter
 * Signature: (Lnet/cp/jlibical/ICalParameter;)V
 */
JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1parameter
  (JNIEnv *env, jobject jobj, jobject arg)
{
	ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		ICalParameter* icalparameter = getSubjectAsICalParameter(env,arg,JLIBICAL_ERR_ILLEGAL_ARGUMENT);

		if (icalparameter != NULL)
		{
			cObj->set_parameter(*icalparameter);
		}
	}
}
/*
 * Class:     net_cp_jlibical_ICalParameter
 * Method:    as_ical_string
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalParameter_as_1ical_1string
  (JNIEnv *env, jobject jobj)
{
	jstring result = NULL;
	ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL);

	if (cObj != NULL)
	{
		char* icalStr = cObj->as_ical_string();

		if (icalStr == NULL)
		{
			icalStr = "";
		}

		result = env->NewStringUTF(icalStr);
	}

	return(result);
}
/*
 * 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);
}