Browse Source

added UID to event and fixed dtend parsing

main
Stefan Pranger 3 years ago
parent
commit
eec728876b
  1. 4
      ical/Event.cpp
  2. 3
      ical/Event.h

4
ical/Event.cpp

@ -7,8 +7,9 @@ namespace ical {
}
void Event::parse(icalcomponent* event_component) {
uid = icalcomponent_get_uid(event_component);
dtstart = icalcomponent_get_dtstart(event_component);
dtend = icalcomponent_get_dtstart(event_component);
dtend = icalcomponent_get_dtend(event_component);
summary = std::string(icalcomponent_get_summary(event_component));
parse_alarms(event_component);
}
@ -25,6 +26,7 @@ namespace ical {
std::string Event::print() const {
std::string s = "";
s += "UID: " + uid + "\n";
s += "DTSTART: " + std::string(icaltime_as_ical_string(dtstart)) + "\n";
s += "DTEND: " + std::string(icaltime_as_ical_string(dtend)) + "\n";
s += "SUMMARY: " + summary + "\n";

3
ical/Event.h

@ -16,8 +16,11 @@ namespace ical {
void parse(icalcomponent* event);
void parse_alarms(icalcomponent* event_component);
std::string
std::string print() const;
private:
std::string uid;
std::string summary;
icaltimetype dtstart;
icaltimetype dtend;

Loading…
Cancel
Save