summaryrefslogtreecommitdiff
path: root/epg_events.cpp
blob: 3940a57f433046ccf4609c23ba01beb0eb987b28 (plain)
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
#include "tools.h"

#include "epg_events.h"

namespace vdrlive
{
	EpgEvent::EpgEvent(const std::string& id,
					   const std::string& caption,
					   const std::string& title,
					   const std::string& short_descr,
					   const std::string& long_descr,
					   time_t start_time,
					   time_t end_time) :
		m_eventId(id),
		m_caption(caption),
		m_title(title),
		m_short_descr(short_descr),
		m_long_descr(long_descr),
		m_start_time(start_time),
		m_end_time(end_time)
	{
	}

	EpgEvent::EpgEvent(const std::string& id, const cEvent* event, const char* channelName) :
		m_eventId(id),
		m_caption(channelName),
		m_title(event->Title() ? event->Title() : ""),
		m_short_descr(event->ShortText() ? event->ShortText() : ""),
		m_long_descr(event->Description() ? event->Description() : ""),
		m_start_time(event->StartTime()),
		m_end_time(event->EndTime())
	{
	}

	EpgEvent::~EpgEvent()
	{
	}

	const std::string EpgEvent::StartTime(const char* format) const
	{
		return FormatDateTime(format, m_start_time);
	}

	const std::string EpgEvent::EndTime(const char* format) const
	{
		return FormatDateTime(format, m_end_time);
	}

	EpgEvents::EpgEvents() :
		std::vector<EpgEventPtr>()
	{
	}

	EpgEvents::~EpgEvents()
	{
	}
#ifdef never
	EpgEventsPtr EpgEvents::dim(size_t count)
	{
		EpgEventsPtr ePtr(new EpgEvents(count));
		return ePtr;
	}
#endif
}; // namespace vdrlive