Data-ICal
view release on metacpan or search on metacpan
NAME
Data::ICal - Generates iCalendar (RFC 2445) calendar files
INSTALLATION
perl Makefile.PL
make
make test
make install
SYNOPSIS
use Data::ICal;
my $calendar = Data::ICal->new();
my $vtodo = Data::ICal::Entry::Todo->new();
$vtodo->add_properties(
# ... see Data::ICal::Entry::Todo documentation
);
# ... or
$calendar = Data::ICal->new(filename => 'foo.ics'); # parse existing file
$calendar = Data::ICal->new(data => 'BEGIN:VCALENDAR...'); # parse from scalar
$calendar->add_entry($vtodo);
print $calendar->as_string;
DESCRIPTION
A Data::ICal object represents a "VCALENDAR" object as defined in the
iCalendar protocol (RFC 2445, MIME type "text/calendar"), as implemented
in many popular calendaring programs such as Apple's iCal.
Each Data::ICal object is a collection of "entries", which are objects
of a subclass of Data::ICal::Entry. The types of entries defined by
iCalendar (which refers to them as "components") include events, to-do
items, journal entries, free/busy time indicators, and time zone
descriptors; in addition, events and to-do items can contain alarm
entries. (Currently, Data::ICal only implements to-do items and events.)
Data::ICal is a subclass of Data::ICal::Entry; see its manpage for more
methods applicable to Data::ICal.
METHODS
new [ data => $data, ] [ filename => $file ], [ vcal10 => $bool ]
Creates a new Data::ICal object.
If it is given a filename or data argument is passed, then this parses
the content of the file or string into the object. If the "vcal10" flag
is passed, parses it according to vCalendar 1.0, not iCalendar 2.0; this
in particular impacts the parsing of continuation lines in
quoted-printable sections.
If a filename or data argument is not passed, this just sets its
"VERSION" and "PRODID" properties to "2.0" (or "1.0" if the "vcal10"
flag is passed) and the value of the "product_id" method respectively.
Returns a false value upon failure to open or parse the file or data;
this false value is a Class::ReturnValue object and can be queried as to
its "error_message".
parse [ data => $data, ] [ filename => $file, ]
Parse a ".ics" file or string containing one, and populate $self with
its contents.
Should only be called once on a given object, and will be automatically
called by "new" if you provide arguments to "new".
Returns $self on success. Returns a false value upon failure to open or
parse the file or data; this false value is a Class::ReturnValue object
and can be queried as to its "error_message".
ical_entry_type
Returns "VCALENDAR", its iCalendar entry name.
product_id
Returns the product ID used in the calendar's "PRODID" property; you may
wish to override this in a subclass for your own application.
mandatory_unique_properties
According to the iCalendar standard, the following properties must be
specified exactly one time for a calendar:
prodid version
optional_unique_properties
According to the iCalendar standard, the following properties may be
specified at most one time for a calendar:
calscale method
DEPENDENCIES
Data::ICal requires Class::Accessor, Text::vFile::asData,
MIME::QuotedPrint, and Class::ReturnValue.
BUGS AND LIMITATIONS
Data::ICal does not support time zone daylight or standard entries, so
( run in 1.315 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )