diff options
Diffstat (limited to 'src/java/net_cp_jlibical_VComponent_cxx.cpp')
-rw-r--r-- | src/java/net_cp_jlibical_VComponent_cxx.cpp | 710 |
1 files changed, 360 insertions, 350 deletions
diff --git a/src/java/net_cp_jlibical_VComponent_cxx.cpp b/src/java/net_cp_jlibical_VComponent_cxx.cpp index cd27d34e..d9e1fb5e 100644 --- a/src/java/net_cp_jlibical_VComponent_cxx.cpp +++ b/src/java/net_cp_jlibical_VComponent_cxx.cpp @@ -1,8 +1,18 @@ -/* /*====================================================================== FILE: net_cp_jlibical_VComponent_cxx.cpp CREATOR: gnorman 1/10/02 (C) COPYRIGHT 2002, Critical Path + + This library is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html + + Or: + + The Mozilla Public License Version 2.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ ======================================================================*/ #ifndef NET_CP_JLIBICAL_VCOMPONENT_CXX_H @@ -33,23 +43,23 @@ JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_as_1ical_1string (JNIEnv *env, jobject jobj) { - jstring result = NULL; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jstring result = NULL; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - char* icalStr = cObj->as_ical_string(); + if (cObj != NULL) + { + char* icalStr = cObj->as_ical_string(); - if (icalStr == NULL) - { - icalStr = ""; - } + if (icalStr == NULL) + { + icalStr = ""; + } - result = env->NewStringUTF(icalStr); - } + result = env->NewStringUTF(icalStr); + } - return(result); + return(result); } /* @@ -60,16 +70,16 @@ JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_as_1ical_1string JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_isa (JNIEnv *env, jobject jobj) { - jint result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jint result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - result = cObj->isa(); - } + if (cObj != NULL) + { + result = cObj->isa(); + } - return(result); + return(result); } /* @@ -80,25 +90,25 @@ JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_isa JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_VComponent_isa_1component (JNIEnv *env, jobject jobj, jobject candidateObj) { - jboolean result = 0; + jboolean result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - void* candidateValue = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + void* candidateValue = 0; - if (candidateObj != NULL) - { - // get the c++ object from candidateObj (as long) - candidateValue = getCObjectPtr(env,candidateObj); - } + if (candidateObj != NULL) + { + // get the c++ object from candidateObj (as long) + candidateValue = getCObjectPtr(env,candidateObj); + } - // 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_component(candidateValue) != 0; - } + // 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_component(candidateValue) != 0; + } - return(result); + return(result); } /* @@ -109,18 +119,18 @@ JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_VComponent_isa_1component JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1property (JNIEnv *env, jobject jobj, jobject jprop) { - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the ICalProperty c++ object from jprop - ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the ICalProperty c++ object from jprop + ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); - if (icalProperty != NULL) - { - cObj->add_property(icalProperty); - } - } + if (icalProperty != NULL) + { + cObj->add_property(icalProperty); + } + } } /* @@ -131,18 +141,18 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1property JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1property (JNIEnv *env, jobject jobj, jobject jprop) { - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the ICalProperty c++ object from jprop - ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the ICalProperty c++ object from jprop + ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); - if (icalProperty != NULL) - { - cObj->remove_property(icalProperty); - } - } + if (icalProperty != NULL) + { + cObj->remove_property(icalProperty); + } + } } /* @@ -153,16 +163,16 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1property JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1properties (JNIEnv *env, jobject jobj, jint kind) { - jint result = 0; + jint result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - result = cObj->count_properties((icalproperty_kind)kind); - } + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + result = cObj->count_properties((icalproperty_kind)kind); + } - return(result); + return(result); } /* @@ -173,20 +183,20 @@ JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1properties JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1property (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the current property from CObj - ICalProperty* aProperty = cObj->get_current_property(); + if (cObj != NULL) + { + // get the current property from CObj + ICalProperty* aProperty = cObj->get_current_property(); - // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). - result = createNewICalPropertySurrogate(env,aProperty); - } + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } - return(result); + return(result); } /* @@ -197,20 +207,20 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1property JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1property (JNIEnv *env, jobject jobj, jint kind) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the first property from CObj - ICalProperty* aProperty = cObj->get_first_property((icalproperty_kind)kind); + if (cObj != NULL) + { + // get the first property from CObj + ICalProperty* aProperty = cObj->get_first_property((icalproperty_kind)kind); - // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). - result = createNewICalPropertySurrogate(env,aProperty); - } + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } - return(result); + return(result); } /* @@ -221,19 +231,19 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1property JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1property (JNIEnv *env, jobject jobj, jint kind) { - jobject result = 0; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the next property from CObj - ICalProperty* aProperty = cObj->get_next_property((icalproperty_kind)kind); + if (cObj != NULL) + { + // get the next property from CObj + ICalProperty* aProperty = cObj->get_next_property((icalproperty_kind)kind); - // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). - result = createNewICalPropertySurrogate(env,aProperty); - } + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } - return(result); + return(result); } /* @@ -244,19 +254,19 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1property JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1inner (JNIEnv *env, jobject jobj) { - jobject result = 0; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the next property from CObj - VComponent* inner = cObj->get_inner(); + if (cObj != NULL) + { + // get the next property from CObj + VComponent* inner = cObj->get_inner(); - // create a new surrogate, using inner as the subject (returns NULL if subject is NULL). - result = createNewVComponentSurrogate(env,inner); - } + // create a new surrogate, using inner as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,inner); + } - return(result); + return(result); } /* @@ -267,18 +277,18 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1inner JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1component (JNIEnv *env, jobject jobj, jobject jcomp) { - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the VComponent c++ object from jcomp - VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the VComponent c++ object from jcomp + VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); - if (aComponent != NULL) - { - cObj->add_component(aComponent); - } - } + if (aComponent != NULL) + { + cObj->add_component(aComponent); + } + } } /* @@ -289,18 +299,18 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1component JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1component (JNIEnv *env, jobject jobj, jobject jcomp) { - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the VComponent c++ object from jcomp - VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the VComponent c++ object from jcomp + VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); - if (aComponent != NULL) - { - cObj->remove_component(aComponent); - } - } + if (aComponent != NULL) + { + cObj->remove_component(aComponent); + } + } } /* @@ -311,16 +321,16 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1component JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1components (JNIEnv *env, jobject jobj, jint kind) { - jint result = 0; + jint result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - result = cObj->count_components((icalcomponent_kind)kind); - } + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + result = cObj->count_components((icalcomponent_kind)kind); + } - return(result); + return(result); } /* @@ -331,19 +341,19 @@ JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1components JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1component (JNIEnv *env, jobject jobj) { - jobject result = 0; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the next property from CObj - VComponent* aComponent = cObj->get_current_component(); + if (cObj != NULL) + { + // get the next property from CObj + VComponent* aComponent = cObj->get_current_component(); - // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). - result = createNewVComponentSurrogate(env,aComponent); - } + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } - return(result); + return(result); } /* @@ -354,20 +364,20 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1componen JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1component (JNIEnv *env, jobject jobj, jint kind) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the first component from CObj - VComponent* aComponent = cObj->get_first_component((icalcomponent_kind)kind); + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_first_component((icalcomponent_kind)kind); - // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). - result = createNewVComponentSurrogate(env,aComponent); - } + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } - return(result); + return(result); } /* @@ -378,20 +388,20 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1component JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1component (JNIEnv *env, jobject jobj, jint kind) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the first component from CObj - VComponent* aComponent = cObj->get_next_component((icalcomponent_kind)kind); + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_next_component((icalcomponent_kind)kind); - // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). - result = createNewVComponentSurrogate(env,aComponent); - } + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } - return(result); + return(result); } /* @@ -402,20 +412,20 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1component JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstart (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the dtstart time from CObj - icaltimetype aTime = cObj->get_dtstart(); + if (cObj != NULL) + { + // get the dtstart time from CObj + icaltimetype aTime = cObj->get_dtstart(); // create a new surrogate, using aTime as the subject. - result = createNewICalTimeType(env,&aTime); - } + result = createNewICalTimeType(env,&aTime); + } - return(result); + return(result); } /* @@ -426,19 +436,19 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstart JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstart (JNIEnv *env, jobject jobj, jobject dtstart) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - icaltimetype aStartTime; + if (cObj != NULL) + { + icaltimetype aStartTime; - if (copyObjToicaltimetype(env,dtstart,&aStartTime)) - { - cObj->set_dtstart(aStartTime); - } - } + if (copyObjToicaltimetype(env,dtstart,&aStartTime)) + { + cObj->set_dtstart(aStartTime); + } + } } /* @@ -449,21 +459,21 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstart JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtend (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the dtend time from CObj - icaltimetype aTime = cObj->get_dtend(); + if (cObj != NULL) + { + // get the dtend time from CObj + icaltimetype aTime = cObj->get_dtend(); - // create a new surrogate, using aTime as the subject. - result = createNewICalTimeType(env,&aTime); + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); - } + } - return(result); + return(result); } /* @@ -474,19 +484,19 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtend JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtend (JNIEnv *env, jobject jobj, jobject dtend) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - icaltimetype anEndTime; + if (cObj != NULL) + { + icaltimetype anEndTime; - if (copyObjToicaltimetype(env,dtend,&anEndTime)) - { - cObj->set_dtend(anEndTime); - } - } + if (copyObjToicaltimetype(env,dtend,&anEndTime)) + { + cObj->set_dtend(anEndTime); + } + } } /* @@ -497,20 +507,20 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtend JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1duration (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the duration time from CObj - icaldurationtype aDuration = cObj->get_duration(); + if (cObj != NULL) + { + // get the duration time from CObj + icaldurationtype aDuration = cObj->get_duration(); - // create a new surrogate, using aDuration as the subject. - result = createNewICalDurationType(env,&aDuration); - } + // create a new surrogate, using aDuration as the subject. + result = createNewICalDurationType(env,&aDuration); + } - return(result); + return(result); } /* @@ -521,19 +531,19 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1duration JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1duration (JNIEnv *env, jobject jobj, jobject duration) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - icaldurationtype aDuration; + if (cObj != NULL) + { + icaldurationtype aDuration; - if (copyObjToicaldurationtype(env,duration,&aDuration)) - { - cObj->set_duration(aDuration); - } - } + if (copyObjToicaldurationtype(env,duration,&aDuration)) + { + cObj->set_duration(aDuration); + } + } } /* @@ -544,15 +554,15 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1duration JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_get_1method (JNIEnv *env, jobject jobj) { - jint result = 0; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jint result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - result = cObj->get_method(); - } + if (cObj != NULL) + { + result = cObj->get_method(); + } - return(result); + return(result); } /* @@ -563,12 +573,12 @@ JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_get_1method JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1method (JNIEnv *env, jobject jobj, jint value) { - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - cObj->set_method((icalproperty_method)value); - } + if (cObj != NULL) + { + cObj->set_method((icalproperty_method)value); + } } /* @@ -579,22 +589,22 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1method JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1summary (JNIEnv *env, jobject jobj) { - jstring result = NULL; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - char* icalStr = cObj->get_summary(); + if (cObj != NULL) + { + char* icalStr = cObj->get_summary(); - if (icalStr == NULL) - { - icalStr = ""; - } + if (icalStr == NULL) + { + icalStr = ""; + } - result = env->NewStringUTF(icalStr); - } + result = env->NewStringUTF(icalStr); + } - return(result); + return(result); } /* @@ -605,15 +615,15 @@ JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1summary JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1summary (JNIEnv *env, jobject jobj, jstring str) { - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - const char* szTemp = env->GetStringUTFChars(str,NULL); + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); - cObj->set_summary((char*)szTemp); - env->ReleaseStringUTFChars(str,szTemp); - } + cObj->set_summary((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } } /* @@ -624,20 +634,20 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1summary JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstamp (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the recurrenceid from CObj - icaltimetype aDTStamp = cObj->get_dtstamp(); + if (cObj != NULL) + { + // get the recurrenceid from CObj + icaltimetype aDTStamp = cObj->get_dtstamp(); // create a new surrogate, using aRecurrenceId as the subject. - result = createNewICalTimeType(env,&aDTStamp); - } + result = createNewICalTimeType(env,&aDTStamp); + } - return(result); + return(result); } /* @@ -648,18 +658,18 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstamp JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstamp (JNIEnv *env, jobject jobj, jobject dtstamp) { - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - icaltimetype aDTStamp; + if (cObj != NULL) + { + icaltimetype aDTStamp; - if (copyObjToicaltimetype(env,dtstamp,&aDTStamp)) - { - cObj->set_dtstamp(aDTStamp); - } - } + if (copyObjToicaltimetype(env,dtstamp,&aDTStamp)) + { + cObj->set_dtstamp(aDTStamp); + } + } } /* @@ -759,22 +769,22 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1description JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1uid (JNIEnv *env, jobject jobj) { - jstring result = NULL; - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - char* icalStr = cObj->get_uid(); + if (cObj != NULL) + { + char* icalStr = cObj->get_uid(); - if (icalStr == NULL) - { - icalStr = ""; - } + if (icalStr == NULL) + { + icalStr = ""; + } - result = env->NewStringUTF(icalStr); - } + result = env->NewStringUTF(icalStr); + } - return(result); + return(result); } /* @@ -785,15 +795,15 @@ JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1uid JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1uid (JNIEnv *env, jobject jobj, jstring str) { - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - const char* szTemp = env->GetStringUTFChars(str,NULL); + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); - cObj->set_uid((char*)szTemp); - env->ReleaseStringUTFChars(str,szTemp); - } + cObj->set_uid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } } /* @@ -804,20 +814,20 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1uid JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1real_1component (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the first component from CObj - VComponent* aComponent = cObj->get_first_real_component(); + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_first_real_component(); - // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). - result = createNewVComponentSurrogate(env,aComponent); - } + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } - return(result); + return(result); } /* @@ -828,7 +838,7 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1real_1comp JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__ (JNIEnv *env, jobject jobj) { - setCObjectPtr(env,jobj,new VComponent()); + setCObjectPtr(env,jobj,new VComponent()); } /* @@ -839,17 +849,17 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__Ljava_lang_String_2 (JNIEnv *env, jobject jobj, jstring str) { - if (str != NULL) - { - const char* szTemp = env->GetStringUTFChars(str,NULL); + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); - setCObjectPtr(env,jobj,new VComponent((char*)szTemp)); - env->ReleaseStringUTFChars(str,szTemp); - } - else - { - throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); - } + setCObjectPtr(env,jobj,new VComponent((char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } } /* @@ -860,7 +870,7 @@ JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__Ljava_lang_String_2 JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__I (JNIEnv *env, jobject jobj, jint kind) { - setCObjectPtr(env,jobj,new VComponent((icalcomponent_kind)kind)); + setCObjectPtr(env,jobj,new VComponent((icalcomponent_kind)kind)); } /* @@ -916,20 +926,20 @@ JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1relcalid JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1recurrenceid (JNIEnv *env, jobject jobj) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - // get the recurrenceid from CObj - icaltimetype aRecurrenceId = cObj->get_recurrenceid(); + if (cObj != NULL) + { + // get the recurrenceid from CObj + icaltimetype aRecurrenceId = cObj->get_recurrenceid(); // create a new surrogate, using aRecurrenceId as the subject. - result = createNewICalTimeType(env,&aRecurrenceId); - } + result = createNewICalTimeType(env,&aRecurrenceId); + } - return(result); + return(result); } /* @@ -940,17 +950,17 @@ JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1recurrenceid JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1recurrenceid (JNIEnv *env, jobject jobj, jobject recurrenceid) { - jobject result = 0; - // get the VComponent c++ object from jobj - VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); - if (cObj != NULL) - { - icaltimetype aRecurrenceId; + if (cObj != NULL) + { + icaltimetype aRecurrenceId; - if (copyObjToicaltimetype(env,recurrenceid,&aRecurrenceId)) - { - cObj->set_recurrenceid(aRecurrenceId); - } - } + if (copyObjToicaltimetype(env,recurrenceid,&aRecurrenceId)) + { + cObj->set_recurrenceid(aRecurrenceId); + } + } } |