📄 codecvt.htm
字号:
<hr>
<pre>
<a name="do-out">
Method do_out()</a>
Access Protected
Classification Modifier
Syntax virtual result do_out(stateT& state,
const internT* from,
const internT* from_end,
const internT*& from_next,
externT* to, externT* to_limit,
externT*& to_next) const;
Parameters <em>state</em> is unspecified.
<em>from</em> is the beginning of the source character
sequence.
<em>from_end</em> is the end of the source character
sequence.
<em>from_next</em> points to character in the source
sequence.
<em>to</em> is the beginning of the destination sequence.
<em>to_limit</em> is the end of the destination sequence.
to_next points to character in the destination sequence.
Return Type <a href="codecvt.htm#Table1">result</a>
</pre>
<h3>Description</h3>
<p>
The do_out() method translates the sequence at [from,from_end)
to a destination sequence stored at [to, to_limit). It translates no more than
(from_end - from) source character elements and stores no more than (to_limit - to)
destination character elements. The method will stop when it encounters
a character in the source sequence that it cannot convert. The <em>from_next</em> and <em>to_next</em>
pointers will point one beyond the last element that was successfully translated.<br>
<br>
If no translation takes place then the method will return <em>noconv</em>. The
pointer <em>to_next</em> will be equal to the argument <em>to</em> and the pointer <em>from_next</em> will
be equal to the argument <em>from</em>. If only some of the characters are translated then
the method will return <em>partial</em>. If <em>from_next</em> == <em>from_end</em> then either
the destination character sequence has not taken in all of the available
destination character elements or that additional source character elements
are required before any another destination character elements can be produced.
</p>
<hr>
<pre>
<a name="do-unshift">
Method do_unshift()</a>
Access Protected
Classification Modifier
Syntax virtual result do_unshift(stateT& state, externT* to,
externT* to_limit,
externT*& to_next) const;
Parameters <em>state</em> reveals the current state.
<em>to</em> is the starting position where the results are
sequentially placed.
<em>to_limit</em> is used to determine the number of
characters that are to be stored.
<em>to_next</em> points to one beyond the last element if
conversion is successful.
Return Type <a href="codecvt.htm#Table2">result</a>
</pre>
<h3>Description</h3>
<p>
The do_unshift() method places characters starting at <em>to</em> that should be appended to termintate
a sequence when the current stateT is given by the argument <em>state</em>. The method returns the
enumerated value <em>error</em>, <em>noconv</em>, <em>ok</em> or <em>partial</em>.
</p>
<hr>
<pre>
<a name="in">
Method in()</a>
Access Public
Classification Modifier
Syntax virtual result in(stateT& state,
const internT* from,
const internT* from_end,
const internT*& from_next,
externT* to, externT* to_limit,
externT*& to_next) const;
Parameters <em>state</em> is unspecified. It can be used to shift
state, to specify conversion options, or used to
identify cache of seek offsets.
<em>from</em> is the beginning of the source character
sequence.
<em>from_end</em> is the end of the source character
sequence.
<em>from_next</em> points to character in the source
sequence.
<em>to</em> is the beginning of the destination sequence.
<em>to_limit</em> is the end of the destination sequence.
<em>to_next</em> points to character in the destination
sequence.
Return Type <a href="codecvt.htm#Table1">result</a>
</pre>
<h3>Description</h3>
<p>
The in() method returns do_in(state, from, from_end, from_next, to, to_limit, to_next).
</p>
<hr>
<pre>
<a name="length">
Method length()</a>
Access Public
Classification Accessor
Syntax int length(const stateT& state, const externT* from,
const externT* end, size_t max) const;
Parameters <em>state</em> is initialized either for the beginning of
a sequence or equal to the result of the previous
conversion of the sequence.
<em>from</em> is the beginning of the character sequence.
<em>end</em> is the end of the character sequence.
<em>max</em> is maximum value of internT characters available
in the specified range.
Return This method returns the number max or fewer internT
characters.
</pre>
<h3>Description</h3>
<p>
The length() method returns do_length(state, from, end, max).
</p>
<hr>
<pre>
<a name="encoding">
Method encoding()</a>
Access Public
Classification Accessor
Syntax int encoding() const throw();
Parameters None
Return This method returns the constant number of externT
characters needed to produce an internal character.
</pre>
<h3>Description</h3>
<p>
The encoding() method returns do_encoding().
</p>
<hr>
<pre>
<a name="max-length">
Method max_length()</a>
Access Public
Classification Accessor
Syntax int max_length() const throw();
Parameters None
Return This method returns the maximum value that
do_length() can return.
</pre>
<h3>Description</h3>
<p>
The max_length() method returns do_max_length().
</p>
<hr>
<pre>
<a name="out">
Method out()</a>
Access Public
Classification Modifier
Syntax result out(stateT& state, const internT* from,
const intern* from_end,
const internT*& from_next,
externT* to, extern* to_limit,
externT*& to_next);
Parameters <em>state</em> is unspecified. It can be used to shift
state, to specify conversion options, or used to
identify cache of seek offsets.
<em>from</em> is the beginning of the source range.
<em>from_end</em> is the end of the source range.
<em>from_next</em> points to one beyond the last element
if conversion is successful.
<em>to</em> is the starting position where the results are
sequentially placed.
<em>to_limit</em> is used to determine the number of
characters that are to be stored.
<em>to_next</em> points to one beyond the last element if
conversion is successful.
Return Type <a href="codecvt.htm#Table1">result</a>
</pre>
<h3>Description</h3>
<p>
The out() method returns do_out(state, from, from_end, from_next, to, to_limit, to_next).
</p>
<hr>
<pre>
<a name="unshift">
Method unshift()</a>
Access Public
Classification Modifier
Syntax result unshift(stateT state&, externT* to,
externT* to_limit,
externT*& to_next) const;
Parameters <em>state</em> reveals the current state.
<em>to</em> is the starting position where the results are
sequentially placed.
<em>to_limit</em> is used to determine the number of
characters that are to be stored.
<em>to_next</em> points to one beyond the last element if
conversion is successful.
Return Type <a href="codecvt.htm#Table2">result</a>
</pre>
<h3>Description</h3>
<p>
The unshift() method returns do_unshift(state, to, to_limit, to_next).
</p>
<hr>
<a name="Table1"><h4>TABLE 1:</h4></a>
<p>
The result values are:
</p>
<hr>
<pre>
<b>Value</b> <b>Meaning</b>
ok The conversion was completed
partial Not all of the source characters were converted.
error A from_type character was encountered and could
not be converted.
noconv No conversion was needed.
</pre>
<hr>
<a name="Table2"><h4>TABLE 2:</h4></a>
<p>
The result values are:
</p>
<hr>
<pre>
<b>Value</b> <b>Meaning</b>
ok The sequence was completed
partial More characters are needed to complete termination.
error <em>state</em> has an invalid value.
noconv For this <em>state_type</em>, no termination is needed.
</pre>
<hr>
<a name="crd"><h2>The Class Relationship Diagram for codecvt</h2></a>
<img src="codecvt.gif">
<hr>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -