-
Notifications
You must be signed in to change notification settings - Fork 4
/
standalone_request.h
55 lines (39 loc) · 1.53 KB
/
standalone_request.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _XSCRIPT_STANDALONE_REQUEST_H_
#define _XSCRIPT_STANDALONE_REQUEST_H_
#include <map>
#include <vector>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <boost/thread/mutex.hpp>
#include "xscript/functors.h"
#include "xscript/request_impl.h"
#include "xscript/util.h"
#include "internal/default_request_response.h"
namespace xscript {
class StandaloneRequest : public DefaultRequestResponse {
public:
StandaloneRequest();
virtual ~StandaloneRequest();
virtual unsigned short getServerPort() const;
virtual const std::string& getServerAddr() const;
virtual const std::string& getPathInfo() const;
virtual const std::string& getPathTranslated() const;
virtual const std::string& getScriptName() const;
virtual const std::string& getScriptFilename() const;
virtual const std::string& getDocumentRoot() const;
virtual const std::string& getQueryString() const;
virtual const std::string& getRequestMethod() const;
virtual bool isSecure() const;
virtual void attach(const std::string &url, const std::string &doc_root);
virtual void detach();
private:
virtual void writeBuffer(const char *buf, std::streamsize size);
virtual void writeError(unsigned short status, const std::string &message);
virtual void writeByWriter(const BinaryWriter *writer);
private:
bool isSecure_;
unsigned short port_;
std::string host_, path_, script_name_, script_file_name_, query_, method_, root_directory_;
};
} // namespace xscript
#endif // _XSCRIPT_STANDALONE_REQUEST_H_