Dave's Brain

Browse - programming tips - libical iterator through recurrances

Date: 2010mar31
Language: C/C++
Product: libical

Q.  Using libical, how do I iterate through all recurrences?

A.  Here's how:


	void AllRecurrences(icalrecurrencetype rule, icaltimetype dtstart)
	{
		icalrecur_iterator*		reit;
		icaltimetype			eventstart

		reit = icalrecur_iterator_new(rule, dtstart);

		for (eventstart = icalrecur_iterator_next(reit);
            	!icaltime_is_null_time(eventstart);
            	eventstart = icalrecur_iterator_next(reit))
		{
			// Process eventstart
		}

		icalrecur_iterator_free(reit);
	}
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: