From eec728876b8a94ca516bde2558d0a66b45e9477e Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Tue, 29 Jun 2021 14:26:40 +0200 Subject: [PATCH] added UID to event and fixed dtend parsing --- ical/Event.cpp | 4 +++- ical/Event.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ical/Event.cpp b/ical/Event.cpp index 308bf83..71694b1 100644 --- a/ical/Event.cpp +++ b/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"; diff --git a/ical/Event.h b/ical/Event.h index 99f3349..5659883 100644 --- a/ical/Event.h +++ b/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;