tmp/tmpu3fmde2e/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
#### Class template `codecvt` <a id="locale.codecvt">[[locale.codecvt]]</a>
|
| 2 |
|
| 3 |
-
##### General <a id="locale.codecvt.general">[[locale.codecvt.general]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
class codecvt_base {
|
| 8 |
public:
|
|
@@ -70,23 +70,20 @@ The `stateT` argument selects the pair of character encodings being
|
|
| 70 |
mapped between.
|
| 71 |
|
| 72 |
The specializations required in [[locale.category.facets]]
|
| 73 |
[[locale.category]] convert the implementation-defined native character
|
| 74 |
set. `codecvt<char, char, mbstate_t>` implements a degenerate
|
| 75 |
-
conversion; it does not convert at all.
|
| 76 |
-
`codecvt<
|
| 77 |
-
|
| 78 |
-
`
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
specializing on a program-defined `stateT` type. Objects of type
|
| 84 |
-
`stateT` can contain any state that is useful to communicate to or from
|
| 85 |
-
the specialized `do_in` or `do_out` members.
|
| 86 |
|
| 87 |
-
##### Members <a id="locale.codecvt.members">[[locale.codecvt.members]]</a>
|
| 88 |
|
| 89 |
``` cpp
|
| 90 |
result out(
|
| 91 |
stateT& state,
|
| 92 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
@@ -134,11 +131,11 @@ int length(stateT& state, const externT* from, const externT* from_end, size_t m
|
|
| 134 |
int max_length() const noexcept;
|
| 135 |
```
|
| 136 |
|
| 137 |
*Returns:* `do_max_length()`.
|
| 138 |
|
| 139 |
-
##### Virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
|
| 140 |
|
| 141 |
``` cpp
|
| 142 |
result do_out(
|
| 143 |
stateT& state,
|
| 144 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
@@ -160,13 +157,13 @@ the sequence.
|
|
| 160 |
destination `to`. Converts no more than `(from_end - from)` source
|
| 161 |
elements, and stores no more than `(to_end - to)` destination elements.
|
| 162 |
|
| 163 |
Stops if it encounters a character it cannot convert. It always leaves
|
| 164 |
the `from_next` and `to_next` pointers pointing one beyond the last
|
| 165 |
-
element successfully converted. If returns `noconv`, `internT` and
|
| 166 |
-
`externT` are the same type and the converted sequence is identical to
|
| 167 |
-
the input sequence \[`from`, `from``next`)
|
| 168 |
`to`, the value of `state` is unchanged, and there are no changes to the
|
| 169 |
values in \[`to`, `to_end`).
|
| 170 |
|
| 171 |
A `codecvt` facet that is used by `basic_filebuf` [[file.streams]] shall
|
| 172 |
have the property that if
|
|
@@ -277,14 +274,14 @@ sequence.
|
|
| 277 |
|
| 278 |
*Effects:* The effect on the `state` argument is as if it called
|
| 279 |
`do_in(state, from, from_end, from, to, to + max, to)` for `to` pointing
|
| 280 |
to a buffer of at least `max` elements.
|
| 281 |
|
| 282 |
-
*Returns:* `(from_next-from)` where `from_next` is the largest value
|
| 283 |
-
the range \[`from`, `from_end`\] such that the sequence of values in
|
| 284 |
-
range \[`from`, `from_next`) represents `max` or fewer valid
|
| 285 |
-
characters of type `internT`. The specialization
|
| 286 |
`codecvt<char, char, mbstate_t>`, returns the lesser of `max` and
|
| 287 |
`(from_end - from)`.
|
| 288 |
|
| 289 |
``` cpp
|
| 290 |
int do_max_length() const noexcept;
|
|
|
|
| 1 |
+
##### Class template `codecvt` <a id="locale.codecvt">[[locale.codecvt]]</a>
|
| 2 |
|
| 3 |
+
###### General <a id="locale.codecvt.general">[[locale.codecvt.general]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
class codecvt_base {
|
| 8 |
public:
|
|
|
|
| 70 |
mapped between.
|
| 71 |
|
| 72 |
The specializations required in [[locale.category.facets]]
|
| 73 |
[[locale.category]] convert the implementation-defined native character
|
| 74 |
set. `codecvt<char, char, mbstate_t>` implements a degenerate
|
| 75 |
+
conversion; it does not convert at all.
|
| 76 |
+
`codecvt<wchar_t, char, mbstate_t>` converts between the native
|
| 77 |
+
character sets for ordinary and wide characters. Specializations on
|
| 78 |
+
`mbstate_t` perform conversion between encodings known to the library
|
| 79 |
+
implementer. Other encodings can be converted by specializing on a
|
| 80 |
+
program-defined `stateT` type. Objects of type `stateT` can contain any
|
| 81 |
+
state that is useful to communicate to or from the specialized `do_in`
|
| 82 |
+
or `do_out` members.
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
+
###### Members <a id="locale.codecvt.members">[[locale.codecvt.members]]</a>
|
| 85 |
|
| 86 |
``` cpp
|
| 87 |
result out(
|
| 88 |
stateT& state,
|
| 89 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
|
|
| 131 |
int max_length() const noexcept;
|
| 132 |
```
|
| 133 |
|
| 134 |
*Returns:* `do_max_length()`.
|
| 135 |
|
| 136 |
+
###### Virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
|
| 137 |
|
| 138 |
``` cpp
|
| 139 |
result do_out(
|
| 140 |
stateT& state,
|
| 141 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
|
|
| 157 |
destination `to`. Converts no more than `(from_end - from)` source
|
| 158 |
elements, and stores no more than `(to_end - to)` destination elements.
|
| 159 |
|
| 160 |
Stops if it encounters a character it cannot convert. It always leaves
|
| 161 |
the `from_next` and `to_next` pointers pointing one beyond the last
|
| 162 |
+
element successfully converted. If it returns `noconv`, `internT` and
|
| 163 |
+
`externT` are the same type, and the converted sequence is identical to
|
| 164 |
+
the input sequence \[`from`, `from``next`), `to_next` is set equal to
|
| 165 |
`to`, the value of `state` is unchanged, and there are no changes to the
|
| 166 |
values in \[`to`, `to_end`).
|
| 167 |
|
| 168 |
A `codecvt` facet that is used by `basic_filebuf` [[file.streams]] shall
|
| 169 |
have the property that if
|
|
|
|
| 274 |
|
| 275 |
*Effects:* The effect on the `state` argument is as if it called
|
| 276 |
`do_in(state, from, from_end, from, to, to + max, to)` for `to` pointing
|
| 277 |
to a buffer of at least `max` elements.
|
| 278 |
|
| 279 |
+
*Returns:* `(from_next - from)` where `from_next` is the largest value
|
| 280 |
+
in the range \[`from`, `from_end`\] such that the sequence of values in
|
| 281 |
+
the range \[`from`, `from_next`) represents `max` or fewer valid
|
| 282 |
+
complete characters of type `internT`. The specialization
|
| 283 |
`codecvt<char, char, mbstate_t>`, returns the lesser of `max` and
|
| 284 |
`(from_end - from)`.
|
| 285 |
|
| 286 |
``` cpp
|
| 287 |
int do_max_length() const noexcept;
|