fastdo  0.6.16
http_RspOutputMgr.hpp
浏览该文件的文档.
1 #ifndef __HTTP_RSPOUTPUTMGR_HPP__
2 #define __HTTP_RSPOUTPUTMGR_HPP__
3 
4 namespace http
5 {
6 
12 {
13 public:
15  RspOutputMgr();
16 
18  virtual ~RspOutputMgr();
19 
24  void setLocalEncoding( winux::String const & local );
25 
29  void setTargetEncoding( winux::String const & target );
30 
32  winux::String getLocalEncoding() const;
33 
35  winux::String getTargetEncoding() const;
36 
38  winux::String convFrom( winux::String const & str ) const;
39 
41  winux::String convTo( winux::String const & str ) const;
42 
44  http::Header & header();
45 
47  http::Header const & header() const;
48 
49 public:
51  void echo( winux::String const & str );
52 
54  void write( void const * data, size_t size );
55 
57  void printf( char const * format, va_list va );
58 
60  std::ostream & out();
61 
63  size_t getOutputSize() const;
64 
68  size_t getConvertedOutputSize();
69 
73  virtual void commit();
74 
76  virtual void resumeStd();
77 
79  virtual void redirectToSpec();
80 
81 protected:
82 
86  bool _isNeedEncodingConvert() const;
87 
93  int _tryEncodingConvert();
94 
96  virtual void _actualOutput( void const * data, size_t size );
97 
99  virtual void _actualError( void const * data, size_t size );
100 
105 
110 
113 
115  std::ostream _out;
117  std::streambuf * _coutOriginStreamBuf;
120 
121 #if defined(OS_WIN)
123 #else
125 #endif
126 private:
127  friend class Response;
129 };
130 
131 
132 } // namespace http
133 
134 
135 #endif // __HTTP_RSPOUTPUTMGR_HPP__
XString< char > AnsiString
Definition: utilities.hpp:257
bool _headerCommited
指示头部是否已经提交发送到输出流
std::streamsize _cacheOutStreamBufConvertedSize
已经完成编码转换的缓冲区数据大小,这个用来判断是否还需要转码
代表HTTP头部
Definition: http_Header.hpp:10
#define HTTPWRAPPER_DLL
Definition: http_base.hpp:24
XString< tchar > String
Definition: utilities.hpp:261
HTTP协议的相关简单类封装
Definition: http_base.hpp:32
#define DISABLE_OBJECT_COPY(clsname)
Definition: utilities.hpp:85
winux::AnsiString _bufConverted
已经进行编码转换的内容
winux::String _targetEncoding
要输出的编码
winux::PlainMembers< struct RspOutputMgr_Data, 88 > _self
std::streambuf * _coutOriginStreamBuf
保存原始的标准输出流缓冲区
std::ostream _out
输出流
Plain成员隐藏(By plain block)
Definition: utilities.hpp:536
HTTP响应
http::Header _header
HTTP头部信息
响应输出管理器
winux::String _localEncoding
本地编码