|
a/src/httpfs.hxx |
|
b/src/httpfs.hxx |
|
... |
|
... |
18 |
*/
|
18 |
*/
|
19 |
|
19 |
|
20 |
#include <string>
|
20 |
#include <string>
|
21 |
#include <unordered_map>
|
21 |
#include <unordered_map>
|
22 |
|
22 |
|
23 |
#include "libupnpp/device/device.hxx" // for VDirContent
|
23 |
#include "libupnpp/device/device.hxx"
|
24 |
|
24 |
|
25 |
extern bool initHttpFs(std::unordered_map<std::string,
|
25 |
// Ad-hoc struct to hold the input identification parameters for the device(s)
|
26 |
UPnPProvider::VDirContent>& files,
|
26 |
struct UDevIds {
|
27 |
const std::string& datadir,
|
27 |
std::string fname;
|
28 |
const std::string& UUID,
|
28 |
std::string uuid;
|
29 |
const std::string& friendlyname,
|
29 |
std::string fnameMS;
|
|
|
30 |
std::string uuidMS;
|
|
|
31 |
};
|
|
|
32 |
|
|
|
33 |
/**
|
|
|
34 |
* Initialize the files which will be served by libupnp HTTP server.
|
|
|
35 |
*
|
|
|
36 |
* The output files are the device and service description xml
|
|
|
37 |
* files. Some of the content is constant, some depends on data
|
|
|
38 |
* elements and what services are actually enabled. The source XML files which
|
|
|
39 |
* we include or modify are found in @param datadir.
|
|
|
40 |
* @param[output] files "file system" content as required by a
|
|
|
41 |
* UPnPProvider::UpnpDevice constructor.
|
|
|
42 |
* @param datadir The location for the source files.
|
|
|
43 |
* @param ids the friendly names and uuids for the devices, for embedding
|
|
|
44 |
* in desc files
|
|
|
45 |
*/
|
|
|
46 |
extern bool initHttpFs(
|
|
|
47 |
std::unordered_map<std::string, UPnPProvider::VDirContent>& files,
|
|
|
48 |
const std::string& datadir, const UDevIds& ids,
|
30 |
bool enableAV, bool enableOH, bool enableReceiver,
|
49 |
bool enableAV, bool enableOH, bool enableReceiver,
|
31 |
bool enableMediaServer, bool msonly,
|
50 |
bool enableMediaServer, bool msonly,
|
32 |
const std::string& iconpath,
|
51 |
const std::string& iconpath, const std::string& presentationhtml
|
33 |
const std::string& presentationhtml
|
|
|
34 |
);
|
52 |
);
|
35 |
|
53 |
|
36 |
inline std::string uuidMediaServer(const std::string& uuid) {
|
|
|
37 |
return uuid + "-mediaserver";
|
|
|
38 |
}
|
|
|
39 |
inline std::string friendlyNameMediaServer(const std::string& f) {
|
|
|
40 |
return f + "-mediaserver";
|
|
|
41 |
}
|
|
|
42 |
#endif /* _HTTPFS_H_X_INCLUDED_ */
|
54 |
#endif /* _HTTPFS_H_X_INCLUDED_ */
|