tmp/tmpbh83h8yz/{from.md → to.md}
RENAMED
|
@@ -3,49 +3,42 @@
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT>
|
| 6 |
class ctype : public locale::facet, public ctype_base {
|
| 7 |
public:
|
| 8 |
-
|
| 9 |
|
| 10 |
explicit ctype(size_t refs = 0);
|
| 11 |
|
| 12 |
bool is(mask m, charT c) const;
|
| 13 |
const charT* is(const charT* low, const charT* high, mask* vec) const;
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
const charT* scan_not(mask m,
|
| 17 |
-
const charT* low, const charT* high) const;
|
| 18 |
charT toupper(charT c) const;
|
| 19 |
const charT* toupper(charT* low, const charT* high) const;
|
| 20 |
charT tolower(charT c) const;
|
| 21 |
const charT* tolower(charT* low, const charT* high) const;
|
| 22 |
|
| 23 |
charT widen(char c) const;
|
| 24 |
const char* widen(const char* low, const char* high, charT* to) const;
|
| 25 |
char narrow(charT c, char dfault) const;
|
| 26 |
-
|
| 27 |
-
char* to) const;
|
| 28 |
|
| 29 |
static locale::id id;
|
| 30 |
|
| 31 |
protected:
|
| 32 |
~ctype();
|
| 33 |
virtual bool do_is(mask m, charT c) const;
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
const charT* low, const charT* high) const;
|
| 38 |
-
virtual const charT* do_scan_not(mask m,
|
| 39 |
-
const charT* low, const charT* high) const;
|
| 40 |
virtual charT do_toupper(charT) const;
|
| 41 |
virtual const charT* do_toupper(charT* low, const charT* high) const;
|
| 42 |
virtual charT do_tolower(charT) const;
|
| 43 |
virtual const charT* do_tolower(charT* low, const charT* high) const;
|
| 44 |
virtual charT do_widen(char) const;
|
| 45 |
-
|
| 46 |
-
charT* dest) const;
|
| 47 |
virtual char do_narrow(charT, char dfault) const;
|
| 48 |
virtual const charT* do_narrow(const charT* low, const charT* high,
|
| 49 |
char dfault, char* dest) const;
|
| 50 |
};
|
| 51 |
}
|
|
@@ -66,54 +59,54 @@ appropriate to the implementation’s native character set.
|
|
| 66 |
bool is(mask m, charT c) const;
|
| 67 |
const charT* is(const charT* low, const charT* high,
|
| 68 |
mask* vec) const;
|
| 69 |
```
|
| 70 |
|
| 71 |
-
*Returns:* `do_is(m,c)` or `do_is(low,high,vec)`
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
const charT* scan_is(mask m,
|
| 75 |
const charT* low, const charT* high) const;
|
| 76 |
```
|
| 77 |
|
| 78 |
-
*Returns:* `do_scan_is(m,low,high)`
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
const charT* scan_not(mask m,
|
| 82 |
const charT* low, const charT* high) const;
|
| 83 |
```
|
| 84 |
|
| 85 |
-
*Returns:* `do_scan_not(m,low,high)`
|
| 86 |
|
| 87 |
``` cpp
|
| 88 |
charT toupper(charT) const;
|
| 89 |
const charT* toupper(charT* low, const charT* high) const;
|
| 90 |
```
|
| 91 |
|
| 92 |
-
*Returns:* `do_toupper(c)` or `do_toupper(low,high)`
|
| 93 |
|
| 94 |
``` cpp
|
| 95 |
charT tolower(charT c) const;
|
| 96 |
const charT* tolower(charT* low, const charT* high) const;
|
| 97 |
```
|
| 98 |
|
| 99 |
-
*Returns:* `do_tolower(c)` or `do_tolower(low,high)`
|
| 100 |
|
| 101 |
``` cpp
|
| 102 |
charT widen(char c) const;
|
| 103 |
const char* widen(const char* low, const char* high, charT* to) const;
|
| 104 |
```
|
| 105 |
|
| 106 |
-
*Returns:* `do_widen(c)` or `do_widen(low,high,to)`
|
| 107 |
|
| 108 |
``` cpp
|
| 109 |
char narrow(charT c, char dfault) const;
|
| 110 |
-
const charT* narrow(const charT* low, const charT*, char dfault,
|
| 111 |
char* to) const;
|
| 112 |
```
|
| 113 |
|
| 114 |
-
*Returns:* `do_narrow(c,dfault)` or `do_narrow(low,high,dfault,to)`
|
| 115 |
|
| 116 |
##### `ctype` virtual functions <a id="locale.ctype.virtuals">[[locale.ctype.virtuals]]</a>
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
bool do_is(mask m, charT c) const;
|
|
@@ -122,30 +115,29 @@ const charT* do_is(const charT* low, const charT* high,
|
|
| 122 |
```
|
| 123 |
|
| 124 |
*Effects:* Classifies a character or sequence of characters. For each
|
| 125 |
argument character, identifies a value `M` of type `ctype_base::mask`.
|
| 126 |
The second form identifies a value `M` of type `ctype_base::mask` for
|
| 127 |
-
each `*p` where `(low<=p && p<high)`, and places it into
|
|
|
|
| 128 |
|
| 129 |
*Returns:* The first form returns the result of the expression
|
| 130 |
`(M & m) != 0`; i.e., `true` if the character has the characteristics
|
| 131 |
specified. The second form returns `high`.
|
| 132 |
|
| 133 |
``` cpp
|
| 134 |
-
const charT* do_scan_is(mask m,
|
| 135 |
-
const charT* low, const charT* high) const;
|
| 136 |
```
|
| 137 |
|
| 138 |
*Effects:* Locates a character in a buffer that conforms to a
|
| 139 |
classification `m`.
|
| 140 |
|
| 141 |
-
*Returns:* The smallest pointer `p` in the range
|
| 142 |
-
`is(m,*p)` would return `true`; otherwise, returns `high`.
|
| 143 |
|
| 144 |
``` cpp
|
| 145 |
-
const charT* do_scan_not(mask m,
|
| 146 |
-
const charT* low, const charT* high) const;
|
| 147 |
```
|
| 148 |
|
| 149 |
*Effects:* Locates a character in a buffer that fails to conform to a
|
| 150 |
classification `m`.
|
| 151 |
|
|
@@ -185,16 +177,16 @@ const char* do_widen(const char* low, const char* high,
|
|
| 185 |
charT* dest) const;
|
| 186 |
```
|
| 187 |
|
| 188 |
*Effects:* Applies the simplest reasonable transformation from a `char`
|
| 189 |
value or sequence of `char` values to the corresponding `charT` value or
|
| 190 |
-
values.[^
|
| 191 |
required are those in the basic source character set ([[lex.charset]]).
|
| 192 |
|
| 193 |
For any named `ctype` category with a `ctype <charT>` facet `ctc` and
|
| 194 |
valid `ctype_base::mask` value `M`,
|
| 195 |
-
`(ctc.is(M, c) || !is(M, do_widen(c)) )` is `true`.[^
|
| 196 |
|
| 197 |
The second form transforms each character `*p` in the range \[`low`,
|
| 198 |
`high`), placing the result in `dest[p - low]`.
|
| 199 |
|
| 200 |
*Returns:* The first form returns the transformed value. The second form
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT>
|
| 6 |
class ctype : public locale::facet, public ctype_base {
|
| 7 |
public:
|
| 8 |
+
using char_type = charT;
|
| 9 |
|
| 10 |
explicit ctype(size_t refs = 0);
|
| 11 |
|
| 12 |
bool is(mask m, charT c) const;
|
| 13 |
const charT* is(const charT* low, const charT* high, mask* vec) const;
|
| 14 |
+
const charT* scan_is(mask m, const charT* low, const charT* high) const;
|
| 15 |
+
const charT* scan_not(mask m, const charT* low, const charT* high) const;
|
|
|
|
|
|
|
| 16 |
charT toupper(charT c) const;
|
| 17 |
const charT* toupper(charT* low, const charT* high) const;
|
| 18 |
charT tolower(charT c) const;
|
| 19 |
const charT* tolower(charT* low, const charT* high) const;
|
| 20 |
|
| 21 |
charT widen(char c) const;
|
| 22 |
const char* widen(const char* low, const char* high, charT* to) const;
|
| 23 |
char narrow(charT c, char dfault) const;
|
| 24 |
+
const charT* narrow(const charT* low, const charT* high, char dfault, char* to) const;
|
|
|
|
| 25 |
|
| 26 |
static locale::id id;
|
| 27 |
|
| 28 |
protected:
|
| 29 |
~ctype();
|
| 30 |
virtual bool do_is(mask m, charT c) const;
|
| 31 |
+
virtual const charT* do_is(const charT* low, const charT* high, mask* vec) const;
|
| 32 |
+
virtual const charT* do_scan_is(mask m, const charT* low, const charT* high) const;
|
| 33 |
+
virtual const charT* do_scan_not(mask m, const charT* low, const charT* high) const;
|
|
|
|
|
|
|
|
|
|
| 34 |
virtual charT do_toupper(charT) const;
|
| 35 |
virtual const charT* do_toupper(charT* low, const charT* high) const;
|
| 36 |
virtual charT do_tolower(charT) const;
|
| 37 |
virtual const charT* do_tolower(charT* low, const charT* high) const;
|
| 38 |
virtual charT do_widen(char) const;
|
| 39 |
+
virtual const char* do_widen(const char* low, const char* high, charT* dest) const;
|
|
|
|
| 40 |
virtual char do_narrow(charT, char dfault) const;
|
| 41 |
virtual const charT* do_narrow(const charT* low, const charT* high,
|
| 42 |
char dfault, char* dest) const;
|
| 43 |
};
|
| 44 |
}
|
|
|
|
| 59 |
bool is(mask m, charT c) const;
|
| 60 |
const charT* is(const charT* low, const charT* high,
|
| 61 |
mask* vec) const;
|
| 62 |
```
|
| 63 |
|
| 64 |
+
*Returns:* `do_is(m, c)` or `do_is(low, high, vec)`.
|
| 65 |
|
| 66 |
``` cpp
|
| 67 |
const charT* scan_is(mask m,
|
| 68 |
const charT* low, const charT* high) const;
|
| 69 |
```
|
| 70 |
|
| 71 |
+
*Returns:* `do_scan_is(m, low, high)`.
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
const charT* scan_not(mask m,
|
| 75 |
const charT* low, const charT* high) const;
|
| 76 |
```
|
| 77 |
|
| 78 |
+
*Returns:* `do_scan_not(m, low, high)`.
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
charT toupper(charT) const;
|
| 82 |
const charT* toupper(charT* low, const charT* high) const;
|
| 83 |
```
|
| 84 |
|
| 85 |
+
*Returns:* `do_toupper(c)` or `do_toupper(low, high)`.
|
| 86 |
|
| 87 |
``` cpp
|
| 88 |
charT tolower(charT c) const;
|
| 89 |
const charT* tolower(charT* low, const charT* high) const;
|
| 90 |
```
|
| 91 |
|
| 92 |
+
*Returns:* `do_tolower(c)` or `do_tolower(low, high)`.
|
| 93 |
|
| 94 |
``` cpp
|
| 95 |
charT widen(char c) const;
|
| 96 |
const char* widen(const char* low, const char* high, charT* to) const;
|
| 97 |
```
|
| 98 |
|
| 99 |
+
*Returns:* `do_widen(c)` or `do_widen(low, high, to)`.
|
| 100 |
|
| 101 |
``` cpp
|
| 102 |
char narrow(charT c, char dfault) const;
|
| 103 |
+
const charT* narrow(const charT* low, const charT* high, char dfault,
|
| 104 |
char* to) const;
|
| 105 |
```
|
| 106 |
|
| 107 |
+
*Returns:* `do_narrow(c, dfault)` or `do_narrow(low, high, dfault, to)`.
|
| 108 |
|
| 109 |
##### `ctype` virtual functions <a id="locale.ctype.virtuals">[[locale.ctype.virtuals]]</a>
|
| 110 |
|
| 111 |
``` cpp
|
| 112 |
bool do_is(mask m, charT c) const;
|
|
|
|
| 115 |
```
|
| 116 |
|
| 117 |
*Effects:* Classifies a character or sequence of characters. For each
|
| 118 |
argument character, identifies a value `M` of type `ctype_base::mask`.
|
| 119 |
The second form identifies a value `M` of type `ctype_base::mask` for
|
| 120 |
+
each `*p` where `(low <= p && p < high)`, and places it into
|
| 121 |
+
`vec[p - low]`.
|
| 122 |
|
| 123 |
*Returns:* The first form returns the result of the expression
|
| 124 |
`(M & m) != 0`; i.e., `true` if the character has the characteristics
|
| 125 |
specified. The second form returns `high`.
|
| 126 |
|
| 127 |
``` cpp
|
| 128 |
+
const charT* do_scan_is(mask m, const charT* low, const charT* high) const;
|
|
|
|
| 129 |
```
|
| 130 |
|
| 131 |
*Effects:* Locates a character in a buffer that conforms to a
|
| 132 |
classification `m`.
|
| 133 |
|
| 134 |
+
*Returns:* The smallest pointer `p` in the range \[`low`, `high`) such
|
| 135 |
+
that `is(m, *p)` would return `true`; otherwise, returns `high`.
|
| 136 |
|
| 137 |
``` cpp
|
| 138 |
+
const charT* do_scan_not(mask m, const charT* low, const charT* high) const;
|
|
|
|
| 139 |
```
|
| 140 |
|
| 141 |
*Effects:* Locates a character in a buffer that fails to conform to a
|
| 142 |
classification `m`.
|
| 143 |
|
|
|
|
| 177 |
charT* dest) const;
|
| 178 |
```
|
| 179 |
|
| 180 |
*Effects:* Applies the simplest reasonable transformation from a `char`
|
| 181 |
value or sequence of `char` values to the corresponding `charT` value or
|
| 182 |
+
values.[^5] The only characters for which unique transformations are
|
| 183 |
required are those in the basic source character set ([[lex.charset]]).
|
| 184 |
|
| 185 |
For any named `ctype` category with a `ctype <charT>` facet `ctc` and
|
| 186 |
valid `ctype_base::mask` value `M`,
|
| 187 |
+
`(ctc.is(M, c) || !is(M, do_widen(c)) )` is `true`.[^6]
|
| 188 |
|
| 189 |
The second form transforms each character `*p` in the range \[`low`,
|
| 190 |
`high`), placing the result in `dest[p - low]`.
|
| 191 |
|
| 192 |
*Returns:* The first form returns the transformed value. The second form
|