add some more files to gitignore
[openblackhole/openblackhole-enigma2.git] / lib / network / http_dyn.h
1 #ifndef __http_dyn_h_
2 #define __http_dyn_h_
3 #include <string>
4 #include <lib/network/httpd.h>
5
6 class eHTTPDyn: public eHTTPDataSource
7 {
8         DECLARE_REF(eHTTPDyn);
9         std::string result;
10         int wptr, size;
11 public:
12         eHTTPDyn(eHTTPConnection *c, std::string result);
13         ~eHTTPDyn();
14         int doWrite(int);
15 };
16
17 class eHTTPDynPathResolver: public iHTTPPathResolver
18 {
19         DECLARE_REF(eHTTPDynPathResolver);
20         struct eHTTPDynEntry: public iObject
21         {
22                 DECLARE_REF(eHTTPDynEntry);
23         public:
24                 std::string request, path;
25                 std::string (*function)(std::string request, std::string path, std::string opt, eHTTPConnection *content);
26                 
27                 eHTTPDynEntry(std::string request, std::string path, std::string (*function)(std::string, std::string, std::string, eHTTPConnection *)): request(request), path(path), function(function)
28                 {
29                 }
30         };
31         eSmartPtrList<eHTTPDynEntry> dyn;
32 public:
33         void addDyn(std::string request, std::string path, std::string (*function)(std::string, std::string, std::string, eHTTPConnection *conn));
34         eHTTPDynPathResolver();
35         RESULT getDataSource(eHTTPDataSourcePtr &ptr, std::string request, std::string path, eHTTPConnection *conn);
36 };
37
38 #endif