std::codecvt::unshift
STD::codecvt::unShift,do[医]不移位
Defined in header | | |
---|---|---|
public: result unshift( StateT& state, ExternT* to, ExternT* to_end, ExternT*& to_next) const; | (1) | |
protected: virtual result do_unshift( StateT& state, ExternT* to, ExternT* to_end, ExternT*& to_next) const; | (2) | |
1%29公共成员函数,调用成员函数。do_unshift
最派生的类。
2%29如果由以下代码表示的编码codecvt
facet是状态依赖的,并且state
表示不是初始Shift状态的转换状态,写入返回到初始Shift状态所需的字符。将字符写入字符数组,该数组的第一个元素由to
.不超过to_end-to
文字都是写的。参数to_next
更新为指向最后写的字符之一。
返回值
类型值std::codecvt_base::result
,说明成功情况如下:
ok | all necessary characters were written. state now represents initial shift state |
---|---|
partial | not enough space in the output buffer. to_next == to_end |
error | unspecified error occurred |
noconv | the encoding is not state-dependent, no termination sequence necessary |
非转换专业化std::codecvt<char, char,std::mbstate_t>总是回来std::codecvt_base::noconv...
注记
此函数由std::basic_filebuf::close()
在其他情况下,当最后确定状态相关的多字节字符序列时。
例
另见
wcrtomb | converts a wide character to its multibyte representation, given state (function) |
---|---|
do_out virtual | converts a string from internT to externT, such as when writing to file (virtual protected member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。