forked from sourcesimian/uICAL
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalendarentry.cpp
More file actions
65 lines (57 loc) · 1.7 KB
/
Copy pathcalendarentry.cpp
File metadata and controls
65 lines (57 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*############################################################################
# Copyright (c) 2020 Source Simian : https://github.com/sourcesimian/uICAL #
############################################################################*/
#include "uICAL/cppstl.h"
#include "uICAL/types.h"
#include "uICAL/error.h"
#include "uICAL/calendarentry.h"
namespace uICAL
{
CalendarEntry::CalendarEntry(Type type, const string &summary, const string &location, const DateTime &start, bool start_has_time, const DateTime &end, bool end_has_time)
{
this->_type = type;
this->_summary = summary;
this->_location = location;
this->_start = start;
this->_end = end;
this->start_has_time = start_has_time;
this->end_has_time = end_has_time;
}
CalendarEntry::Type CalendarEntry::type() const
{
return this->_type;
}
string CalendarEntry::asString(Type type)
{
switch (type)
{
case Type::EVENT:
return "EVENT";
case Type::NONE:
default:
return "UNKNOWN";
}
}
const string CalendarEntry::summary() const
{
return this->_summary;
}
const string CalendarEntry::location() const
{
return this->_location;
}
DateTime CalendarEntry::start() const
{
return this->_start;
}
DateTime CalendarEntry::end() const
{
return this->_end;
}
void CalendarEntry::str(ostream &out) const
{
out << "Calendar " << this->asString(this->_type) << ": " << this->_summary << uICAL::endl;
out << " - start: " << this->_start << uICAL::endl;
out << " - end: " << this->_end << uICAL::endl;
}
}