From Jason Turner

[locale.codecvt.virtuals]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphps_45hn/{from.md → to.md} +19 -18
tmp/tmphps_45hn/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- ##### `codecvt` virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
2
 
3
  ``` cpp
4
  result do_out(
5
  stateT& state,
6
  const internT* from, const internT* from_end, const internT*& from_next,
@@ -10,14 +10,14 @@ result do_in(
10
  stateT& state,
11
  const externT* from, const externT* from_end, const externT*& from_next,
12
  internT* to, internT* to_end, internT*& to_next) const;
13
  ```
14
 
15
- *Requires:* `(from <= from_end && to <= to_end)` well-defined and
16
- `true`; `state` initialized, if at the beginning of a sequence, or else
17
- equal to the result of converting the preceding characters in the
18
- sequence.
19
 
20
  *Effects:* Translates characters in the source range \[`from`,
21
  `from_end`), placing the results in sequential positions starting at
22
  destination `to`. Converts no more than `(from_end - from)` source
23
  elements, and stores no more than `(to_end - to)` destination elements.
@@ -28,12 +28,12 @@ element successfully converted. If returns `noconv`, `internT` and
28
  `externT` are the same type and the converted sequence is identical to
29
  the input sequence \[`from`, `from``next`). `to_next` is set equal to
30
  `to`, the value of `state` is unchanged, and there are no changes to the
31
  values in \[`to`, `to_end`).
32
 
33
- A `codecvt` facet that is used by `basic_filebuf` ([[file.streams]])
34
- shall have the property that if
35
 
36
  ``` cpp
37
  do_out(state, from, from_end, from_next, to, to_end, to_next)
38
  ```
39
 
@@ -66,13 +66,13 @@ shall also return `ok`.[^8]
66
  [*Note 2*: This argument can be used, for example, to maintain shift
67
  state, to specify conversion options (such as count only), or to
68
  identify a cache of seek offsets. — *end note*]
69
 
70
  *Returns:* An enumeration value, as summarized in
71
- Table  [[tab:localization.convert.result.values.out.in]].
72
 
73
- **Table: `do_in/do_out` result values** <a id="tab:localization.convert.result.values.out.in">[tab:localization.convert.result.values.out.in]</a>
74
 
75
  | Value | Meaning |
76
  | --------- | ------------------------------------------------------------------------------------------------ |
77
  | `ok` | completed the conversion |
78
  | `partial` | not all source characters converted |
@@ -87,24 +87,24 @@ before another destination element can be produced.
87
 
88
  ``` cpp
89
  result do_unshift(stateT& state, externT* to, externT* to_end, externT*& to_next) const;
90
  ```
91
 
92
- *Requires:* `(to <= to_end)` well defined and `true`; state initialized,
93
- if at the beginning of a sequence, or else equal to the result of
94
- converting the preceding characters in the sequence.
95
 
96
  *Effects:* Places characters starting at `to` that should be appended to
97
  terminate a sequence when the current `stateT` is given by `state`.[^9]
98
  Stores no more than `(to_end - to)` destination elements, and leaves the
99
  `to_next` pointer pointing one beyond the last element successfully
100
  stored.
101
 
102
  *Returns:* An enumeration value, as summarized in
103
- Table  [[tab:localization.convert.result.values.unshift]].
104
 
105
- **Table: `do_unshift` result values** <a id="tab:localization.convert.result.values.unshift">[tab:localization.convert.result.values.unshift]</a>
106
 
107
  | Value | Meaning |
108
  | --------- | -------------------------------------------------------------------------------------------------------------------- |
109
  | `ok` | completed the sequence |
110
  | `partial` | space for more than `to_end - to` destination elements was needed to terminate a sequence given the value of `state` |
@@ -129,15 +129,16 @@ valid argument values. `codecvt<char, char, mbstate_t>` returns `true`.
129
 
130
  ``` cpp
131
  int do_length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
132
  ```
133
 
134
- *Requires:* `(from <= from_end)` well-defined and `true`; `state`
135
- initialized, if at the beginning of a sequence, or else equal to the
136
- result of converting the preceding characters in the sequence.
 
137
 
138
- *Effects:* The effect on the `state` argument is as if it called
139
  `do_in(state, from, from_end, from, to, to+max, to)` for `to` pointing
140
  to a buffer of at least `max` elements.
141
 
142
  *Returns:* `(from_next-from)` where `from_next` is the largest value in
143
  the range \[`from`, `from_end`\] such that the sequence of values in the
 
1
+ ##### Virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
2
 
3
  ``` cpp
4
  result do_out(
5
  stateT& state,
6
  const internT* from, const internT* from_end, const internT*& from_next,
 
10
  stateT& state,
11
  const externT* from, const externT* from_end, const externT*& from_next,
12
  internT* to, internT* to_end, internT*& to_next) const;
13
  ```
14
 
15
+ *Preconditions:* `(from <= from_end && to <= to_end)` is well-defined
16
+ and `true`; `state` is initialized, if at the beginning of a sequence,
17
+ or else is equal to the result of converting the preceding characters in
18
+ the sequence.
19
 
20
  *Effects:* Translates characters in the source range \[`from`,
21
  `from_end`), placing the results in sequential positions starting at
22
  destination `to`. Converts no more than `(from_end - from)` source
23
  elements, and stores no more than `(to_end - to)` destination elements.
 
28
  `externT` are the same type and the converted sequence is identical to
29
  the input sequence \[`from`, `from``next`). `to_next` is set equal to
30
  `to`, the value of `state` is unchanged, and there are no changes to the
31
  values in \[`to`, `to_end`).
32
 
33
+ A `codecvt` facet that is used by `basic_filebuf` [[file.streams]] shall
34
+ have the property that if
35
 
36
  ``` cpp
37
  do_out(state, from, from_end, from_next, to, to_end, to_next)
38
  ```
39
 
 
66
  [*Note 2*: This argument can be used, for example, to maintain shift
67
  state, to specify conversion options (such as count only), or to
68
  identify a cache of seek offsets. — *end note*]
69
 
70
  *Returns:* An enumeration value, as summarized in
71
+ [[locale.codecvt.inout]].
72
 
73
+ **Table: `do_in/do_out` result values** <a id="locale.codecvt.inout">[locale.codecvt.inout]</a>
74
 
75
  | Value | Meaning |
76
  | --------- | ------------------------------------------------------------------------------------------------ |
77
  | `ok` | completed the conversion |
78
  | `partial` | not all source characters converted |
 
87
 
88
  ``` cpp
89
  result do_unshift(stateT& state, externT* to, externT* to_end, externT*& to_next) const;
90
  ```
91
 
92
+ *Preconditions:* `(to <= to_end)` is well-defined and `true`; `state` is
93
+ initialized, if at the beginning of a sequence, or else is equal to the
94
+ result of converting the preceding characters in the sequence.
95
 
96
  *Effects:* Places characters starting at `to` that should be appended to
97
  terminate a sequence when the current `stateT` is given by `state`.[^9]
98
  Stores no more than `(to_end - to)` destination elements, and leaves the
99
  `to_next` pointer pointing one beyond the last element successfully
100
  stored.
101
 
102
  *Returns:* An enumeration value, as summarized in
103
+ [[locale.codecvt.unshift]].
104
 
105
+ **Table: `do_unshift` result values** <a id="locale.codecvt.unshift">[locale.codecvt.unshift]</a>
106
 
107
  | Value | Meaning |
108
  | --------- | -------------------------------------------------------------------------------------------------------------------- |
109
  | `ok` | completed the sequence |
110
  | `partial` | space for more than `to_end - to` destination elements was needed to terminate a sequence given the value of `state` |
 
129
 
130
  ``` cpp
131
  int do_length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
132
  ```
133
 
134
+ *Preconditions:* `(from <= from_end)` is well-defined and `true`;
135
+ `state` is initialized, if at the beginning of a sequence, or else is
136
+ equal to the result of converting the preceding characters in the
137
+ sequence.
138
 
139
+ *Effects:* The effect on the `state` argument is as if it called
140
  `do_in(state, from, from_end, from, to, to+max, to)` for `to` pointing
141
  to a buffer of at least `max` elements.
142
 
143
  *Returns:* `(from_next-from)` where `from_next` is the largest value in
144
  the range \[`from`, `from_end`\] such that the sequence of values in the