diff options
author | Denis Loh <denis.loh@web.de> | 2012-09-13 20:01:49 +0200 |
---|---|---|
committer | Denis Loh <denis.loh@web.de> | 2012-09-13 20:01:49 +0200 |
commit | 4d808c7f57e7de856154c7d13b6d2dc6501bb6fc (patch) | |
tree | fac25d52dae381703533f417cd7f400bc74317e9 /include/webserver.h | |
download | vdr-plugin-upnp-4d808c7f57e7de856154c7d13b6d2dc6501bb6fc.tar.gz vdr-plugin-upnp-4d808c7f57e7de856154c7d13b6d2dc6501bb6fc.tar.bz2 |
Initial commit
Diffstat (limited to 'include/webserver.h')
-rw-r--r-- | include/webserver.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/webserver.h b/include/webserver.h new file mode 100644 index 0000000..240d4d6 --- /dev/null +++ b/include/webserver.h @@ -0,0 +1,66 @@ +/* + * webserver.h + * + * Created on: 06.08.2012 + * Author: savop + */ + +#ifndef WEBSERVER_H_ +#define WEBSERVER_H_ + +#include <tnt/tntnet.h> +#include <stdint.h> +#include <string> +#include <vdr/thread.h> + +namespace upnp { + + class cMediaServer; + + class cWebserver { + public: + cWebserver(std::string address); + virtual ~cWebserver(); + + void SetWebserverRootDir(std::string rootDirectory, std::string staticContentUrl, std::string presentationUrl); + void SetServiceUrl(std::string descriptionUrl, std::string controlUrl); + + void SetListenerPort(uint16_t port); + + bool Initialise(); + + bool Start(); + void Stop(); + + const std::string GetBaseUrl() const; + const std::string GetServiceUrl() const; + const std::string GetControlUrl() const; + const std::string GetStaticContentUrl() const; + const std::string GetPresentationUrl() const; + + std::string GetListenerAddress() const { return mListenerAddress; } + uint16_t GetListenerPort() const { return mListenerPort; } + + private: + tnt::Tntnet mApplication; + std::string mWebserverRootDir; + std::string mListenerAddress; + uint16_t mListenerPort; + + std::string mServiceUrl; + std::string mControlUrl; + std::string mStaticContentUrl; + std::string mPresentationUrl; + + class cWSThread : public cThread { + public: + cWSThread(cWebserver& webServer); + virtual void Action(void); + private: + cWebserver& mWebserver; + } mWebserverThread; + }; + +}; + +#endif /* WEBSERVER_H_ */ |