From a3da4f3811789a10f741b74232747b22e82d0a02 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Sun, 27 Jun 2021 14:05:25 +0200 Subject: [PATCH] cleaned up some debug output --- ical/Alarm.cpp | 2 +- ical/Alarm.h | 2 +- ical/Event.cpp | 9 +++++---- ical/Event.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ical/Alarm.cpp b/ical/Alarm.cpp index 8640509..9c0e645 100644 --- a/ical/Alarm.cpp +++ b/ical/Alarm.cpp @@ -35,7 +35,7 @@ namespace ical { } } - std::string Alarm::print() { + std::string Alarm::print() const { std::string s = ""; s += "DESCRIPTION: " + description + "\n"; s += trigger == ical::trigger_type::ABSOLUTE ? "ABSOLUTE: " : "RELATIVE: "; diff --git a/ical/Alarm.h b/ical/Alarm.h index b61bd64..23309c8 100644 --- a/ical/Alarm.h +++ b/ical/Alarm.h @@ -22,7 +22,7 @@ namespace ical { void parse_description(icalcomponent* alarm_component); void parse_trigger(icalcomponent* alarm_component); - std::string print(); + std::string print() const; private: action a; trigger_type trigger; diff --git a/ical/Event.cpp b/ical/Event.cpp index d2fcce9..a0ee80d 100644 --- a/ical/Event.cpp +++ b/ical/Event.cpp @@ -12,9 +12,6 @@ namespace ical { summary = std::string(icalcomponent_get_summary(event_component)); parse_alarms(event_component); DEBUG << "\n" << print(); - for(auto& a : alarms) { - DEBUG << "\n" << a.print(); - } object->events.push_back(this); } @@ -28,11 +25,15 @@ namespace ical { } } - std::string Event::print() { + std::string Event::print() const { std::string s = ""; s += "DTSTART: " + std::string(icaltime_as_ical_string(dtstart)) + "\n"; s += "DTEND: " + std::string(icaltime_as_ical_string(dtend)) + "\n"; s += "SUMMARY: " + summary + "\n"; + s += "ALARMS:\n"; + for(auto const& a : alarms) { + s += a.print(); + } return s; } } diff --git a/ical/Event.h b/ical/Event.h index 11bd164..9c5274f 100644 --- a/ical/Event.h +++ b/ical/Event.h @@ -13,7 +13,7 @@ namespace ical { void parse(ical::ical_object* object, icalcomponent* event); void parse_alarms(icalcomponent* event_component); - std::string print(); + std::string print() const; private: std::string summary; icaltimetype dtstart;