fastdo  0.6.16
http_Response.hpp
浏览该文件的文档.
1 #ifndef __HTTP_RESPONSE_HPP__
2 #define __HTTP_RESPONSE_HPP__
3 
4 namespace http
5 {
6 
9 {
10 public:
16 
18  virtual ~Response();
19 
21  void echo( winux::String const & str );
22 
24  void write( void const * data, int size );
25 
27  void write( winux::Buffer const & buf );
28 
30  void printf( char const * format, ... );
31 
35  void commitHeader();
36 
40  void commit();
41 
43  winux::String getLocalEncoding() const;
44 
46  winux::String getTargetEncoding() const;
47 
49  winux::String convFrom( winux::String const & str ) const;
50 
52  winux::String convTo( winux::String const & str ) const;
53 
55  void setCharset( winux::String const & charset );
56 
58  winux::String getCharset() const;
59 
61  void setMimeType( winux::String const & mime ) { _mimeType = mime; }
62 
64  winux::String getMimeType() const { return _mimeType; }
65 
70  void setAutoContentType( bool autoContentType = true ) { _autoContentType = autoContentType; }
71 
73  template < typename _Ty >
74  std::ostream & operator << ( _Ty const & v )
75  {
76  return _outputMgr->out() << v;
77  }
78 
80  RspOutputMgr * getOutputMgr() const { return _outputMgr.get(); }
81 
84 
85 private:
87  winux::String _mimeType;
88  bool _autoContentType;
89 
91 };
92 
93 
94 } // namespace http
95 
96 
97 #endif // __HTTP_RESPONSE_HPP__
代表HTTP头部
Definition: http_Header.hpp:10
#define HTTPWRAPPER_DLL
Definition: http_base.hpp:24
void setAutoContentType(bool autoContentType=true)
是否自动设置Content-Type
XString< tchar > String
Definition: utilities.hpp:261
std::ostream & operator<<(std::ostream &o, Cookie const &cookie)
Definition: http_Cookie.hpp:52
void setMimeType(winux::String const &mime)
设置MIME
http::Header & header
响应头部的引用
HTTP协议的相关简单类封装
Definition: http_base.hpp:32
#define DISABLE_OBJECT_COPY(clsname)
Definition: utilities.hpp:85
HTTP请求
Definition: http_Request.hpp:8
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
Definition: utilities.hpp:906
Request & request
http::Request对象的引用
HTTP响应
简单指针
Definition: smartptr.hpp:302
winux::String getMimeType() const
获取MIME
RspOutputMgr * getOutputMgr() const
暴露输出管理器
响应输出管理器