1 /* -*- Mode: C++ -*- */
4 * @file icalspanlist_cxx.h
5 * @author Critical Path
6 * @brief C++ class wrapping the icalspanlist data structure
8 * This class wraps the icalspanlist routines in libicalss
10 * Errors within libicalss are propagated via exceptions of type
11 * icalerrorenum. See icalerror.h for the complete list of exceptions
12 * that might be thrown.
15 #ifndef ICALSPANLIST_CXX_H
16 #define ICALSPANLIST_CXX_H
18 #include <libical/ical.h>
19 #include <libicalss/icalset.h>
20 #include <libicalss/icalspanlist.h>
21 #include "vcomponent.h"
22 #include <vector> /* For as_matrix.. */
26 /** Construct an ICalSpanList from an icalset */
27 ICalSpanList(icalset *set, icaltimetype start, icaltimetype end) throw(icalerrorenum);
29 /** Construct an ICalSpanList from the VFREEBUSY chunk of a icalcomponent */
30 ICalSpanList(icalcomponent *comp) throw(icalerrorenum);
32 /** Construct an ICalSpanList from the VFREEBUSY chunk of a vcomponent */
33 ICalSpanList(VComponent &comp) throw(icalerrorenum);
38 /** Return a VFREEBUSY icalcomponent */
39 VComponent* get_vfreebusy(const char *organizer, const char *attendee) throw(icalerrorenum);
41 /** Return the base data when casting */
42 operator icalspanlist*() {return data;}
44 /** Return a vector of the number of events over delta t */
45 std::vector<int> as_vector(int delta_t) throw(icalerrorenum);
47 /** Dump the spanlist to stdout */
48 void dump() {icalspanlist_dump(data);}