00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _UPNPWEBSERVER_H
00009 #define _UPNPWEBSERVER_H
00010
00011 #include "../common.h"
00012 #include <upnp/upnp.h>
00013
00021 class cUPnPWebServer {
00022 friend class cUPnPServer;
00023 private:
00024 static cUPnPWebServer *mInstance;
00025 static UpnpVirtualDirCallbacks mVirtualDirCallbacks;
00026 const char* mRootdir;
00027 cUPnPWebServer(const char* root = "/");
00028 protected:
00029 public:
00040 bool init();
00050 bool uninit();
00060 static cUPnPWebServer* getInstance(
00061 const char* rootdir = "/"
00062 );
00063 virtual ~cUPnPWebServer();
00064
00065
00066
00067
00068
00069
00070
00071
00081 static int getInfo(const char* filename, struct File_Info* info);
00097 static UpnpWebFileHandle open(const char* filename, UpnpOpenFileMode mode);
00113 static int read(UpnpWebFileHandle fh, char* buf, size_t buflen);
00129 static int write(UpnpWebFileHandle fh, char* buf, size_t buflen);
00144 static int seek(UpnpWebFileHandle fh, off_t offset, int origin);
00156 static int close(UpnpWebFileHandle fh);
00157 };
00158
00159 #endif
00160