-
Notifications
You must be signed in to change notification settings - Fork 21
/
wirbelscan.h
108 lines (88 loc) · 2.92 KB
/
wirbelscan.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include <vector>
#include <ostream>
#include <cxxtools/http/request.h>
#include <cxxtools/http/reply.h>
#include <cxxtools/http/responder.h>
#include <cxxtools/jsonserializer.h>
#include <cxxtools/serializationinfo.h>
#include <vdr/osdbase.h>
#include <vdr/plugin.h>
#include "tools.h"
#include "wirbelscan/wirbelscan_services.h"
using namespace WIRBELSCAN_SERVICE;
class WirbelscanResponder: public cxxtools::http::Responder {
public:
explicit WirbelscanResponder(cxxtools::http::Service& service) :
cxxtools::http::Responder(service) {};
virtual ~WirbelscanResponder() {};
virtual void reply(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replyCountries(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replySatellites(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replyGetStatus(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replyGetSetup(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replySetSetup(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
virtual void replyDoCmd(std::ostream& out, cxxtools::http::Request& request,
cxxtools::http::Reply& reply);
private:
cPlugin *wirbelscan;
};
typedef cxxtools::http::CachedService<WirbelscanResponder> WirbelscanService;
struct SerListItem
{
int id;
cxxtools::String shortName;
cxxtools::String fullName;
};
void operator<<= (cxxtools::SerializationInfo& si, const SerListItem& l);
class CountryList : public BaseList
{
protected:
StreamExtension *s;
int total;
public:
explicit CountryList(std::ostream* _out);
virtual ~CountryList();
virtual void init() { };
virtual void addCountry(SListItem* country) { };
virtual void finish() { };
virtual void setTotal(int _total) { total = _total; }
};
class JsonCountryList : CountryList
{
private:
std::vector < struct SerListItem > SerCountries;
public:
explicit JsonCountryList(std::ostream* _out) : CountryList(_out) { };
~JsonCountryList() { };
virtual void addCountry(SListItem* country);
virtual void finish();
};
class SatelliteList : public BaseList
{
protected:
StreamExtension *s;
int total;
public:
explicit SatelliteList(std::ostream* _out);
virtual ~SatelliteList();
virtual void init() { };
virtual void addSatellite(SListItem* satellite) { };
virtual void finish() { };
virtual void setTotal(int _total) { total = _total; }
};
class JsonSatelliteList : SatelliteList
{
private:
std::vector < struct SerListItem > SerSatellites;
public:
explicit JsonSatelliteList(std::ostream* _out) : SatelliteList(_out) { };
~JsonSatelliteList() { };
virtual void addSatellite(SListItem* satellite);
virtual void finish();
};