Re: [Evolution-hackers] Creating iCal components
- From: chenthill <pchenthill novell com>
- To: Teresa Thomas <tere ertw gmail com>
- Cc: evolution-hackers gnome org
- Subject: Re: [Evolution-hackers] Creating iCal components
- Date: Wed, 02 Aug 2006 11:40:08 +0530
Hi Teresa,
You can get all the sub-components which are embedded in a main
component by iterating through the main component,
* For getting all the subcomponents *
icalcomponent *subcomp;
icalcompiter iter;
/* icalcomp is the toplevel component */
iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT);
while ((subcomp = icalcompiter_deref (&iter)) != NULL) {
icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
icalcompiter_next (&iter);
}
* For getting VEVENT sub-components alone*
subcomp = icalcomponent_get_first_component (icalcomp,
ICAL_VEVENT_COMPONENT)
while (subcomp != NULL){
subcomp = icalcomponent_get_next_component (icalcomp,
ICAL_VEVENT_COMPONENT);
}
- Chenthill.
On Tue, 2006-08-01 at 23:51 -0400, Teresa Thomas wrote:
> Whoops! The above mail was supposed to be for the author of libical
> docs. But if anyone here knows the answer, then great! :)
>
> On 8/1/06, Teresa Thomas < tere ertw gmail com> wrote:
> Hi
>
> I have a question regarding libical. Since you authored the
> documentation, I figured you would know!
>
> Suppose my iCal string contains multiple events ie, looks as
> follows:
> BEGIN:VCALENDAR
> ...
> BEGIN:VEVENT
> ...
> END:VEVENT
> BEGIN:VEVENT
> ...
> END:VEVENT
> END:VCALENDAR
>
> I'm using the
> icalcomponent* icalcomponent_new_from_string(char* str)
> function to parse it. According to the libical documentation
> "If the string contains multiple components, the multiple
> components will be returned as the children of an
> ICAL_XROOT_COMPONENT component."
>
> What functions can I use to access these children vevent
> components? Code snippets would be great.
>
> Thanks!
>
> Regards,
>
> Teresa
>
>
>
> _______________________________________________
> Evolution-hackers mailing list
> Evolution-hackers gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-hackers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]