summaryrefslogtreecommitdiff
path: root/PlexServer.h
blob: 8f1b23a08169b3a1de46548d18daa68185374535 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef PLEXSERVER_H
#define PLEXSERVER_H

#include <stdlib.h>
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <memory>

#include <Poco/String.h>
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/MessageHeader.h>
#include <Poco/URI.h>

namespace plexclient
{

class PlexServer
{
	friend class plexgdm;

public:
	int GetMaster() const {
		return m_nMaster;
	}

	int GetOwned() const {
		return m_nOwned;
	}
	int GetPort() const {
		return m_nPort;
	}
	const std::string& GetContentType() const {
		return m_sContentType;
	}
	const std::string& GetDiscovery() const {
		return m_sDiscovery;
	}
	const std::string& GetRole() const {
		return m_sRole;
	}
	const std::string& GetServerName() const {
		return m_sServerName;
	}
	long GetUpdated() const {
		return m_nUpdated;
	}
	const std::string& GetUuid() const {
		return m_sUuid;
	}
	const std::string& GetVersion() const {
		return m_sVersion;
	}
	const std::string& GetIpAdress() const {
		return m_sIpAddress;
	}

	std::string GetUri();

	void DiscoverSettings();

protected:
	PlexServer(std::string data, std::string ip);
	PlexServer(std::string ip, int port);
	PlexServer() {};
	
	void ParseData(std::string data, std::string ip);

private:
	std::string m_sDiscovery;

	int m_nOwned;
	int m_nMaster;
	std::string m_sRole;
	std::string m_sContentType;
	std::string m_sUuid;
	std::string m_sServerName;
	std::string m_sIpAddress;
	int m_nPort;
	long m_nUpdated;
	std::string m_sVersion;

};

}
#endif // PLEXSERVER_H