|
fastdo
0.6.16
|
响应输出管理器 更多...
#include <http_RspOutputMgr.hpp>


Public 成员函数 | |
| RspOutputMgr () | |
| 构造函数 更多... | |
| virtual | ~RspOutputMgr () |
| 析构函数 更多... | |
| void | setLocalEncoding (winux::String const &local) |
指定本地编码(Response会自动设置本地编码) 更多... | |
| void | setTargetEncoding (winux::String const &target) |
指定目标编码(Response不会自动设置) 更多... | |
| winux::String | getLocalEncoding () const |
| 获取本地编码 更多... | |
| winux::String | getTargetEncoding () const |
| 获取目标编码 更多... | |
| winux::String | convFrom (winux::String const &str) const |
| 目标编码转到本地编码 更多... | |
| winux::String | convTo (winux::String const &str) const |
| 本地编码转到目标编码 更多... | |
| http::Header & | header () |
| 暴露管理的头部对象 更多... | |
| http::Header const & | header () const |
| 暴露管理的头部对象 更多... | |
| void | echo (winux::String const &str) |
| 输出字符串 更多... | |
| void | write (void const *data, size_t size) |
| 输出二进制数据 更多... | |
| void | printf (char const *format, va_list va) |
| 输出格式化字符串 更多... | |
| std::ostream & | out () |
| 输出流 更多... | |
| size_t | getOutputSize () const |
| 输出了多少字节数据(缓冲区内存在数据的大小) 更多... | |
| size_t | getConvertedOutputSize () |
| 转码后输出了多少字节数据(如果不用转码则返回缓冲区内存在数据的大小;如果需转码则触发转码返回转码后的数据大小) 更多... | |
| virtual void | commit () |
| 提交输出 更多... | |
| virtual void | resumeStd () |
| 恢复标准流 更多... | |
| virtual void | redirectToSpec () |
| 重定向标准流到特定流 更多... | |
Protected 成员函数 | |
| bool | _isNeedEncodingConvert () const |
| 是否需要进行编码转换 更多... | |
| int | _tryEncodingConvert () |
| 尝试编码转换 更多... | |
| virtual void | _actualOutput (void const *data, size_t size) |
| 实际输出 更多... | |
| virtual void | _actualError (void const *data, size_t size) |
| 实际错误输出 更多... | |
Protected 属性 | |
| http::Header | _header |
| HTTP头部信息 更多... | |
| bool | _headerCommited |
| 指示头部是否已经提交发送到输出流 更多... | |
| winux::String | _localEncoding |
| 本地编码 更多... | |
| winux::String | _targetEncoding |
| 要输出的编码 更多... | |
| winux::AnsiString | _bufConverted |
| 已经进行编码转换的内容 更多... | |
| std::ostream | _out |
| 输出流 更多... | |
| std::streambuf * | _coutOriginStreamBuf |
| 保存原始的标准输出流缓冲区 更多... | |
| std::streamsize | _cacheOutStreamBufConvertedSize |
| 已经完成编码转换的缓冲区数据大小,这个用来判断是否还需要转码 更多... | |
| winux::PlainMembers< struct RspOutputMgr_Data, 88 > | _self |
友元 | |
| class | Response |
响应输出管理器
该类把标准流重定向到特定的流接口,以便我们控制实际输出的方式。此类为stdout、stderr输出。
该类会把输出流重定向到一个缓冲区流,从而延缓输出,以便我们方便设置HTTP头、更改字符串编码、计算内容长度
在文件 http_RspOutputMgr.hpp 第 11 行定义.
| http::RspOutputMgr::RspOutputMgr | ( | ) |
构造函数
|
virtual |
析构函数
| void http::RspOutputMgr::setLocalEncoding | ( | winux::String const & | local | ) |
指定本地编码(Response会自动设置本地编码)
本地编码指编译器的默认编码。VisualStudio是GBK,GCC是UTF-8。
设置字符串编码信息setLocalEncoding()/setTargetEncoding()
| void http::RspOutputMgr::setTargetEncoding | ( | winux::String const & | target | ) |
指定目标编码(Response不会自动设置)
目标编码要和Content-Type的charset对应
| winux::String http::RspOutputMgr::getLocalEncoding | ( | ) | const |
获取本地编码
| winux::String http::RspOutputMgr::getTargetEncoding | ( | ) | const |
获取目标编码
| winux::String http::RspOutputMgr::convFrom | ( | winux::String const & | str | ) | const |
目标编码转到本地编码
| winux::String http::RspOutputMgr::convTo | ( | winux::String const & | str | ) | const |
本地编码转到目标编码
| http::Header& http::RspOutputMgr::header | ( | ) |
暴露管理的头部对象
| http::Header const& http::RspOutputMgr::header | ( | ) | const |
暴露管理的头部对象
| void http::RspOutputMgr::echo | ( | winux::String const & | str | ) |
输出字符串
| void http::RspOutputMgr::write | ( | void const * | data, |
| size_t | size | ||
| ) |
输出二进制数据
| void http::RspOutputMgr::printf | ( | char const * | format, |
| va_list | va | ||
| ) |
输出格式化字符串
| std::ostream& http::RspOutputMgr::out | ( | ) |
输出流
| size_t http::RspOutputMgr::getOutputSize | ( | ) | const |
输出了多少字节数据(缓冲区内存在数据的大小)
| size_t http::RspOutputMgr::getConvertedOutputSize | ( | ) |
转码后输出了多少字节数据(如果不用转码则返回缓冲区内存在数据的大小;如果需转码则触发转码返回转码后的数据大小)
会自动触发转码操作
|
virtual |
|
virtual |
恢复标准流
|
virtual |
重定向标准流到特定流
|
protected |
是否需要进行编码转换
不需要转换的情况:a.没有设置本地编码或者目标编码,b.本地编码和目标编码相同,c.MIME不是text类型
|
protected |
尝试编码转换
| 0 | 不需要进行编码转换 |
| 1 | 需要进行编码转换并且执行了 |
| 2 | 需要进行编码转换,由于之前已经转换成功,所以直接返回 |
|
protectedvirtual |
实际输出
被 eienwebx::FcgiRspOutputMgr , 以及 http::HttpRspOutputMgr 重载.
|
protectedvirtual |
实际错误输出
|
friend |
在文件 http_RspOutputMgr.hpp 第 127 行定义.
|
protected |
HTTP头部信息
在文件 http_RspOutputMgr.hpp 第 102 行定义.
|
protected |
指示头部是否已经提交发送到输出流
在文件 http_RspOutputMgr.hpp 第 104 行定义.
|
protected |
本地编码
在文件 http_RspOutputMgr.hpp 第 107 行定义.
|
protected |
要输出的编码
在文件 http_RspOutputMgr.hpp 第 109 行定义.
|
protected |
已经进行编码转换的内容
在文件 http_RspOutputMgr.hpp 第 112 行定义.
|
protected |
输出流
在文件 http_RspOutputMgr.hpp 第 115 行定义.
|
protected |
保存原始的标准输出流缓冲区
在文件 http_RspOutputMgr.hpp 第 117 行定义.
|
protected |
已经完成编码转换的缓冲区数据大小,这个用来判断是否还需要转码
在文件 http_RspOutputMgr.hpp 第 119 行定义.
|
protected |
在文件 http_RspOutputMgr.hpp 第 124 行定义.