When the function returns, from_next and to_next point to one beyond the last element successfully converted.
The translation stops if a character cannot be translated, in which case it returns codecvt::error.
If the destination range cannot absorb all the characters to be translated, or if the generation of a new translated character requires more characters beyond from_end, it returns codecvt::partial.
If both template parameters internT and externT are the same type, the function simply copies the contents and returns codecvt::noconv.
On success, it returns codecvt::ok.
During its operation, this function simply calls the virtual protected member codecvt::do_in, which is the member function in charge of performing the actions described above.
- State object to keep track of the state of a multibyte character conversion. Typically, this is an object of type mbstate_t.
stateT is the state type (i.e., the third template parameter of codecvt).
- from, from_end
- Pointer to the initial and final characters of the source sequence. The range used is [from,from_end), which contains all the characters between from and from_end, including the character pointed by from but not the character pointed by from_end.
externT is the external character type (i.e., the second template parameter of codecvt).
- Pointer type able to point to an element in the above range. Once the function returns, this object points to the element in the source range beyond the last one successfully translated.
- to, to_limit
- Pointer to the initial and final characters of the destination sequence. The range used is [to,to_limit), which contains all the characters between to and to_limit, including the character pointed by to but not the character pointed by to_limit.
A translation does not necessarily need to fill up the range to its limit, and may also exhaust it (in which case it returns codecvt::partial).
internT is the internal character type (i.e., the first template parameter of codecvt).
- Pointer type able to point to an element in the above range. Once the function returns, this object points to the element in the destination range beyond the last one successfully translated.
Return valueAn object of type codecvt::result, with the following possible values:
|partial||Not all source characters converted|
|error||A character in the source could not be converted|
|noconv||Source and destination character types are the same. No conversion technique used.|
Translation successful: Test string
|codecvt::out||Translate out characters (public member function)|
|codecvt::unshift||Unshift translation state (public member function)|
|codecvt::do_in||Translate in characters [virtual] (virtual protected member function)|