82 |
|
class HttpHandler |
83 |
|
{ |
84 |
|
private: |
85 |
+ |
enum code {ok = 200, choices = 300, moved = 301, found = 302, notfound = |
86 |
+ |
404, internal = 500}; |
87 |
|
#ifdef _WIN32 |
88 |
|
WSADATA data; |
89 |
|
#endif // _WIN32 |
93 |
|
string page; |
94 |
|
string type; |
95 |
|
unsigned length; |
96 |
+ |
string location; |
97 |
|
void putline(const string line = ""); |
98 |
+ |
string getline(); |
99 |
|
void error(const string prefix, bool host = false); |
100 |
|
public: |
101 |
|
HttpHandler(); |
106 |
|
void clear(); |
107 |
|
string contentType() { return type; } |
108 |
|
unsigned contentLength() { return length; } |
109 |
+ |
string redirect() { return location; } |
110 |
|
}; |
111 |
|
|
112 |
|
#endif // _HttpHandler_h_ |