std::wbuffer_convert
STD::WBuffer[医]转换
Defined in header | | |
---|
template<class Codecvt, class Elem = wchar_t, class Tr = std::char_traits<Elem> > class wbuffer_convert : public std::basic_streambuf<Elem, Tr> | | (since C++11) (deprecated in C++17) |
std::wbuffer_convert类型的流缓冲区上的包装器。std::basic_streambuf<char>这让它看起来std::basic_streambuf<Elem>.所有I/O操作通过std::wbuffer_convert完成由facet定义的字符转换。Codecvt...std::wbuffer_convert假定转换面的所有权,并且不能使用由区域设置管理的方面。适用于与std::wbuffer_convert是std::codecvt_utf8对于UTF-8/UC 2和UTF-8/UC 4转换和std::codecvt_utf8_utf16对于UTF-8/UTF-16转换。
此类模板使隐式字符转换功能具有std::basic_filebuf
可供任何std::basic_streambuf
...
成员类型
Member type | Definition |
---|
state_type | Codecvt::state_type |
成员函数
(constructor) | constructs a new wbuffer_convert (public member function) |
---|
operator= | the copy assignment operator is deleted (public member function) |
(destructor) | destructs the wbuffer_convert and its conversion facet (public member function) |
rdbuf | returns or replaces the underlying narrow stream buffer (public member function) |
state | returns the current conversion state (public member function) |
另见
Characterconversions | locale-defined multibyte(UTF-8, GB18030) | UTF-8 | UTF-16 |
---|
UTF-16 | mbrtoc16 / c16rtomb(with C11's DR488) | codecvt<char16_t, char, mbstate_t>codecvt_utf8_utf16<char16_t>codecvt_utf8_utf16<char32_t>codecvt_utf8_utf16<wchar_t> | N/A |
UCS2 | c16rtomb(without C11's DR488) | codecvt_utf8<char16_t> codecvt_utf8<wchar_t>(Windows). | codecvt_utf16<char16_t> codecvt_utf16<wchar_t>(Windows). |
UTF-32 | mbrtoc32 / c32rtomb. | codecvt<char32_t, char, mbstate_t> codecvt_utf8<char32_t> codecvt_utf8<wchar_t>(non-Windows). | codecvt_utf16<char32_t> codecvt_utf16<wchar_t>(non-Windows). |
system wide:UTF-32(non-Windows)UCS2(Windows) | mbsrtowcs / wcsrtombs use_facet<codecvt <wchar_t, char, mbstate_t>>(locale). | No | No |
wstring_convert (C++11)(deprecated in C++17) | performs conversions between a wide string and a byte string (class template) |
---|
codecvt_utf8 (C++11)(deprecated in C++17) | converts between UTF-8 and UCS2/UCS4 (class template) |
codecvt_utf8_utf16 (C++11)(deprecated in C++17) | converts between UTF-8 and UTF-16 (class template) |
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/locale/wBuffer[医]转换