forked from Saman-VDR/vdr-plugin-restfulapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.h
62 lines (53 loc) · 1.55 KB
/
info.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
#include <cxxtools/http/request.h>
#include <cxxtools/http/reply.h>
#include <cxxtools/http/responder.h>
#include <cxxtools/jsonserializer.h>
#include <cxxtools/serializationinfo.h>
#include "tools.h"
#include <time.h>
#include <vector>
#include "statusmonitor.h"
struct SerService
{
cxxtools::String Path;
int Version;
bool Internal;
};
struct SerPlugin
{
cxxtools::String Name;
cxxtools::String Version;
};
struct SerPluginList
{
cxxtools::String Version;
std::vector< struct SerPlugin > plugins;
};
struct SerPlayerInfo
{
cxxtools::String Name;
cxxtools::String FileName;
};
struct SerDiskSpaceInfo
{
int FreeMB;
int UsedPercent;
int FreeMinutes;
std::string Description;
};
void operator<<= (cxxtools::SerializationInfo& si, const SerService& s);
void operator<<= (cxxtools::SerializationInfo& si, const SerPlugin& p);
void operator<<= (cxxtools::SerializationInfo& si, const SerPluginList& pl);
void operator<<= (cxxtools::SerializationInfo& si, const SerPlayerInfo& pi);
void operator<<= (cxxtools::SerializationInfo& si, const SerDiskSpaceInfo& ds);
class InfoResponder : public cxxtools::http::Responder
{
public:
explicit InfoResponder(cxxtools::http::Service& service)
: cxxtools::http::Responder(service) { };
virtual void reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply);
virtual void replyHtml(StreamExtension& se);
virtual void replyJson(StreamExtension& se);
virtual void replyXml(StreamExtension& se);
};
typedef cxxtools::http::CachedService<InfoResponder> InfoService;