|
a/libupnpp/device/device.hxx |
|
b/libupnpp/device/device.hxx |
|
... |
|
... |
33 |
|
33 |
|
34 |
namespace UPnPProvider {
|
34 |
namespace UPnPProvider {
|
35 |
|
35 |
|
36 |
typedef std::function<int (const UPnPP::SoapArgs&, UPnPP::SoapData&)> soapfun;
|
36 |
typedef std::function<int (const UPnPP::SoapArgs&, UPnPP::SoapData&)> soapfun;
|
37 |
|
37 |
|
|
|
38 |
// Definition of a virtual directory entry: data and mime type
|
|
|
39 |
struct VDirContent {
|
|
|
40 |
VDirContent(const std::string& ct, const std::string& mt)
|
|
|
41 |
: content(ct), mimetype(mt) {}
|
|
|
42 |
std::string content;
|
|
|
43 |
std::string mimetype;
|
|
|
44 |
};
|
|
|
45 |
|
38 |
/** Define a virtual interface to link libupnp operations to a device
|
46 |
/** Define a virtual interface to link libupnp operations to a device
|
39 |
* implementation
|
47 |
* implementation
|
40 |
*/
|
48 |
*/
|
41 |
class UpnpDevice {
|
49 |
class UpnpDevice {
|
42 |
public:
|
50 |
public:
|
|
|
51 |
/** Construct device object
|
|
|
52 |
* @param deviceId uuid for device: "uuid:UUIDvalue"
|
|
|
53 |
* @param files list of name/content pairs to be added to the
|
|
|
54 |
* virtual directory root. The file names must match the SCDPURL
|
|
|
55 |
* values for the services in the description.xml document. Note that
|
|
|
56 |
* this will have to be changed if we ever want to really
|
|
|
57 |
* support multiple devices (will need to use subdirectories or
|
|
|
58 |
* find another way to avoid name conflicts).
|
|
|
59 |
*/
|
43 |
UpnpDevice(const std::string& deviceId,
|
60 |
UpnpDevice(const std::string& deviceId,
|
44 |
const std::unordered_map<std::string, std::string>& xmlfiles);
|
61 |
const std::unordered_map<std::string, VDirContent>& files);
|
45 |
~UpnpDevice();
|
62 |
~UpnpDevice();
|
46 |
|
63 |
|
47 |
void addService(UpnpService *, const std::string& serviceId);
|
64 |
void addService(UpnpService *, const std::string& serviceId);
|
48 |
|
65 |
|
49 |
/**
|
66 |
/**
|