use setup_<setupkey> as alternative skin name for Setup, for customization of specifi...
[enigma2.git] / lib / network / http_file.h
1 #ifndef __http_file_h
2 #define __http_file_h
3
4 #include "httpd.h"
5
6 class eHTTPFile: public eHTTPDataSource
7 {
8         DECLARE_REF(eHTTPFile);
9 private:        
10         int fd, size;
11         const char *mime;
12         int method;
13 public:
14         enum { methodGET, methodPUT };
15         eHTTPFile(eHTTPConnection *c, int fd, int method, const char *mime);
16         ~eHTTPFile();
17         int doWrite(int);
18         void haveData(void *data, int len);
19 };
20
21 class eHTTPFilePathResolver: public iHTTPPathResolver
22 {
23         DECLARE_REF(eHTTPFilePathResolver);
24 public:
25         struct eHTTPFilePath
26         {
27                 std::string path;
28                 std::string root;
29                 int authorized; // must be authorized (1 means read, 2 write)
30                 eHTTPFilePath(std::string path, std::string root, int authorized): path(path), root(root), authorized(authorized)
31                 {
32                 }
33         };
34         ePtrList<eHTTPFilePath> translate;
35 public:
36         eHTTPFilePathResolver();
37         RESULT getDataSource(eHTTPDataSourcePtr &ptr, std::string request, std::string path, eHTTPConnection *conn);
38         void addTranslation(std::string path, std::string root, int auth);
39 };
40
41 #endif