|
63 | 63 | \indextext{requirements!regular expression traits}%
|
64 | 64 | \indextext{regular expression!requirements}%
|
65 | 65 | \indextext{locale}%
|
66 |
| -In \tref{re.req} \tcode{X} denotes a traits class |
67 |
| -defining types and functions for the character container |
68 |
| -type \tcode{charT}; \tcode{u} is an object of |
69 |
| -type \tcode{X}; \tcode{v} is an object of type \tcode{const |
70 |
| -X}; \tcode{p} is a value of type \tcode{const charT*}; \tcode{I1} |
71 |
| -and \tcode{I2} are input iterators\iref{input.iterators}; |
| 66 | +In the following requirements, |
| 67 | +\begin{itemize} |
| 68 | +\item |
| 69 | +\tcode{X} denotes a traits class defining types and functions |
| 70 | +for the character container type \tcode{charT}; |
| 71 | +\item |
| 72 | +\tcode{u} is an object of type \tcode{X}; |
| 73 | +\item |
| 74 | +\tcode{v} is an object of type \tcode{const X}; |
| 75 | +\item |
| 76 | +\tcode{p} is a value of type \tcode{const charT*}; |
| 77 | +\item |
| 78 | +\tcode{I1} and \tcode{I2} are input iterators\iref{input.iterators}; |
| 79 | +\item |
72 | 80 | \tcode{F1} and \tcode{F2} are forward iterators\iref{forward.iterators};
|
| 81 | +\item |
73 | 82 | \tcode{c} is a value of type \tcode{const charT};
|
| 83 | +\item |
74 | 84 | \tcode{s} is an object of type \tcode{X::string_type};
|
| 85 | +\item |
75 | 86 | \tcode{cs} is an object of type \tcode{const X::string_type};
|
| 87 | +\item |
76 | 88 | \tcode{b} is a value of type \tcode{bool};
|
| 89 | +\item |
77 | 90 | \tcode{I} is a value of type \tcode{int};
|
78 |
| -\tcode{cl} is an object of type \tcode{X::char_class_type}, |
79 |
| -and \tcode{loc} is an object of type \tcode{X::locale_type}. |
80 |
| - |
81 |
| -\begin{libreqtab3} |
82 |
| - {Regular expression traits class requirements} |
83 |
| - {re.req} |
84 |
| -\\ \topline |
85 |
| -\lhdr{Expression} & \chdr{Return type} & \rhdr{Assertion/note pre-/post-condition } \\ \capsep |
86 |
| -\endfirsthead |
87 |
| -\continuedcaption\\ |
88 |
| -\hline |
89 |
| -\lhdr{Expression} & \chdr{Return type} & \rhdr{Assertion/note pre-/post-condition } \\ \capsep |
90 |
| -\endhead |
91 |
| -%% |
| 91 | +\item |
| 92 | +\tcode{cl} is an object of type \tcode{X::char_class_type}; and |
| 93 | +\item |
| 94 | +\tcode{loc} is an object of type \tcode{X::locale_type}. |
| 95 | +\end{itemize} |
| 96 | + |
| 97 | +\pnum |
| 98 | +A traits class \tcode{X} meets the regular expression traits requirements |
| 99 | +if the following types and expressions are well-formed and have the specified |
| 100 | +semantics. |
| 101 | + |
| 102 | +\begin{itemize} |
| 103 | +\item |
| 104 | +The type \tcode{X::char_type} denotes \tcode{charT}, |
| 105 | +the character container type used in the implementation of class |
| 106 | +template \tcode{basic_regex}. |
| 107 | +\item |
| 108 | +The type \tcode{X::string_type} denotes the type \tcode{basic_string<charT>}. |
| 109 | +\item |
| 110 | +The type \tcode{X::locale_type} denotes a copy constructible type |
| 111 | +that represents the locale used by the traits class. |
| 112 | +\item |
| 113 | +The type \tcode{X::char_class_type} denotes a bitmask type\iref{bitmask.types} |
| 114 | +representing a particular character classification. |
| 115 | +\end{itemize} |
| 116 | + |
| 117 | +\begin{itemdecl} |
| 118 | +X::length(p) |
| 119 | +\end{itemdecl} |
| 120 | + |
| 121 | +\begin{itemdescr} |
| 122 | +\pnum |
| 123 | +\returntype |
| 124 | +\tcode{size_t} |
| 125 | + |
| 126 | +\pnum |
| 127 | +\returns |
| 128 | +The smallest \tcode{i} such that \tcode{p[i] == 0}. |
| 129 | + |
| 130 | +\pnum |
| 131 | +\complexity |
| 132 | +Linear in \tcode{i}. |
| 133 | +\end{itemdescr} |
| 134 | + |
| 135 | +\begin{itemdecl} |
| 136 | +v.translate(c) |
| 137 | +\end{itemdecl} |
| 138 | + |
| 139 | +\begin{itemdescr} |
| 140 | +\pnum |
| 141 | +\returntype |
92 | 142 | \tcode{X::char_type}
|
93 |
| - & \tcode{charT} |
94 |
| - & The character container type used in the implementation of class |
95 |
| - template \tcode{basic_regex}. |
96 |
| - \\ \rowsep |
| 143 | + |
| 144 | +\pnum |
| 145 | +\returns |
| 146 | +A character such that for any character \tcode{d} |
| 147 | +that is to be considered equivalent to \tcode{c} |
| 148 | +then \tcode{v.translate(c) == v.translate(d)}. |
| 149 | +\end{itemdescr} |
| 150 | + |
| 151 | +\begin{itemdecl} |
| 152 | +v.translate_nocase(c) |
| 153 | +\end{itemdecl} |
| 154 | + |
| 155 | +\begin{itemdescr} |
| 156 | +\pnum |
| 157 | +\returntype |
| 158 | +\tcode{X::char_type} |
| 159 | + |
| 160 | +\pnum |
| 161 | +\returns |
| 162 | +For all characters \tcode{C} that are to be considered equivalent to \tcode{c} |
| 163 | +when comparisons are to be performed without regard to case, |
| 164 | +then \tcode{v.translate_nocase(c) == v.translate_nocase(C)}. |
| 165 | +\end{itemdescr} |
| 166 | + |
| 167 | +\begin{itemdecl} |
| 168 | +v.transform(F1, F2) |
| 169 | +\end{itemdecl} |
| 170 | + |
| 171 | +\begin{itemdescr} |
| 172 | +\pnum |
| 173 | +\returntype |
97 | 174 | \tcode{X::string_type}
|
98 |
| - & \tcode{basic_string<charT>} |
99 |
| - & |
100 |
| - \\ \rowsep |
101 |
| -\tcode{X::locale_type} |
102 |
| - & A copy constructible type |
103 |
| - & A type that represents the locale used by the traits class. \indextext{locale} |
104 |
| - \\ \rowsep |
| 175 | + |
| 176 | +\pnum |
| 177 | +\returns |
| 178 | +A sort key for the character sequence designated by |
| 179 | +the iterator range \range{F1}{F2} such that |
| 180 | +if the character sequence \range{G1}{G2} sorts before |
| 181 | +the character sequence \range{H1}{H2} |
| 182 | +then \tcode{v.transform(G1, G2) < v.transform(H1, H2)}. |
| 183 | +\end{itemdescr} |
| 184 | + |
| 185 | +\begin{itemdecl} |
| 186 | +v.transform_primary(F1, F2) |
| 187 | +\end{itemdecl} |
| 188 | + |
| 189 | +\begin{itemdescr} |
| 190 | +\pnum |
| 191 | +\indextext{regular expression traits!\idxcode{transform_primary}}% |
| 192 | +\indextext{transform_primary@\tcode{transform_primary}!regular expression traits}% |
| 193 | +\returntype |
| 194 | +\tcode{X::string_type} |
| 195 | + |
| 196 | +\pnum |
| 197 | +\returns |
| 198 | +A sort key for the character sequence designated by |
| 199 | +the iterator range \range{F1}{F2} such that |
| 200 | +if the character sequence \range{G1}{G2} sorts before |
| 201 | +the character sequence \range{H1}{H2} |
| 202 | +when character case is not considered |
| 203 | +then \tcode{v.transform_primary(G1, G2) < v.transform_primary(H1, H2)}. |
| 204 | +\end{itemdescr} |
| 205 | + |
| 206 | +\begin{itemdecl} |
| 207 | +v.lookup_collatename(F1, F2) |
| 208 | +\end{itemdecl} |
| 209 | + |
| 210 | +\begin{itemdescr} |
| 211 | +\pnum |
| 212 | +\returntype |
| 213 | +\tcode{X::string_type} |
| 214 | + |
| 215 | +\pnum |
| 216 | +\returns |
| 217 | +A sequence of characters that represents the collating element |
| 218 | +consisting of the character sequence designated by |
| 219 | +the iterator range \range{F1}{F2}. |
| 220 | +Returns an empty string |
| 221 | +if the character sequence is not a valid collating element. |
| 222 | +\end{itemdescr} |
| 223 | + |
| 224 | +\begin{itemdecl} |
| 225 | +v.lookup_classname(F1, F2, b) |
| 226 | +\end{itemdecl} |
| 227 | + |
| 228 | +\begin{itemdescr} |
| 229 | +\pnum |
| 230 | +\returntype |
105 | 231 | \tcode{X::char_class_type}
|
106 |
| - & A bitmask type\iref{bitmask.types}. |
107 |
| - & A bitmask type representing a particular character classification. |
108 |
| - \\ \rowsep |
109 |
| -\tcode{X::length(p)} |
110 |
| - & \tcode{size_t} |
111 |
| - & Yields the smallest \tcode{i} such that \tcode{p[i] == 0}. Complexity is |
112 |
| - linear in \tcode{i}. |
113 |
| - \\ \rowsep |
114 |
| -\tcode{v.translate(c)} |
115 |
| - & \tcode{X::char_type} |
116 |
| - & Returns a character such that for any character \tcode{d} that is to |
117 |
| - be considered equivalent to \tcode{c} then \tcode{v.translate(c) == v.translate(d)}. |
118 |
| - \\ \rowsep |
119 |
| -\tcode{v.translate_nocase(c)} |
120 |
| - & \tcode{X::char_type} |
121 |
| - & For all characters \tcode{C} that are to be considered equivalent |
122 |
| - to \tcode{c} when comparisons are to be performed without regard to |
123 |
| - case, then \tcode{v.translate_nocase(c) == v.translate_nocase(C)}. |
124 |
| - \\ \rowsep |
125 |
| -\tcode{v.transform(F1, F2)} |
126 |
| - & \tcode{X::string_type} |
127 |
| - & Returns a sort key for the character sequence designated by the |
128 |
| - iterator range \range{F1}{F2} such that if the character sequence |
129 |
| - \range{G1}{G2} sorts before the character sequence \range{H1}{H2} |
130 |
| - then \tcode{v.transform(G1, G2) < v.transform(H1, H2)}. |
131 |
| - \\ \rowsep |
132 |
| -\tcode{v.transform_primary(F1, F2)} |
133 |
| - & \tcode{X::string_type} |
134 |
| - & Returns a sort key for the character sequence designated by the |
135 |
| - iterator range \range{F1}{F2} such that if the character sequence |
136 |
| - \range{G1}{G2} sorts before the character sequence \range{H1}{H2} |
137 |
| - when character case is not considered |
138 |
| - then \tcode{v.transform_primary(G1, G2) < v.transform_primary(H1, H2)}. |
139 |
| - \indextext{regular expression traits!\idxcode{transform_primary}}% |
140 |
| - \indextext{transform_primary@\tcode{transform_primary}!regular expression traits}% |
141 |
| - \\ \rowsep |
142 |
| -\tcode{v.lookup_collatename(F1, F2)} |
143 |
| - & \tcode{X::string_type} |
144 |
| - & Returns a sequence of characters that represents the collating element |
145 |
| - consisting of the character sequence designated by the iterator range |
146 |
| - \range{F1}{F2}. Returns an empty string if the character sequence is not |
147 |
| - a valid collating element. |
148 |
| - \\ \rowsep |
149 |
| -\tcode{v.lookup_classname(F1, F2, b)} |
150 |
| - & \tcode{X::char_class_type} |
151 |
| - & Converts the character sequence designated by the iterator range |
152 |
| - \range{F1}{F2} into a value of a bitmask type that can |
153 |
| - subsequently be passed to \tcode{isctype}. Values returned from |
154 |
| - \tcode{lookup_classname} can be bitwise \logop{OR}'ed together; the |
155 |
| - resulting value represents membership in either of the |
156 |
| - corresponding character classes. |
157 |
| - If \tcode{b} is \tcode{true}, the returned bitmask is suitable for |
158 |
| - matching characters without regard to their case. |
159 |
| - Returns \tcode{0} if the character |
160 |
| - sequence is not the name of a character class recognized by |
161 |
| - \tcode{X}. The value returned shall be independent of the case of |
162 |
| - the characters in the sequence. |
163 |
| - \\ \rowsep |
164 |
| -\tcode{v.isctype(c, cl)} |
165 |
| - & \tcode{bool} |
166 |
| - & Returns \tcode{true} if character \tcode{c} is a member of |
167 |
| - one of the character classes designated by \tcode{cl}, |
168 |
| - \tcode{false} otherwise. |
169 |
| - \\ \rowsep |
170 |
| -\tcode{v.value(c, I)} |
171 |
| - & \tcode{int} |
172 |
| - & Returns the value represented by the digit \textit{c} in base |
173 |
| - \textit{I} if the character \textit{c} is a valid digit in base \textit{I}; |
174 |
| - otherwise returns \tcode{-1}. |
175 |
| -\begin{tailnote} |
176 |
| -The value of \textit{I} will only |
177 |
| - be 8, 10, or 16. |
178 |
| -\end{tailnote} |
179 |
| - \\ \rowsep |
180 |
| -\tcode{u.imbue(loc)} |
181 |
| - & \tcode{X::locale_type} |
182 |
| - & Imbues \tcode{u} with the locale \tcode{loc} and returns the previous locale |
183 |
| - used by \tcode{u} if any. \indextext{locale}% |
184 |
| - \\ \rowsep |
185 |
| -\tcode{v.getloc()} |
186 |
| - & \tcode{X::locale_type} |
187 |
| - & Returns the current locale used by \tcode{v}, if any. \indextext{locale}% |
188 |
| - \\ |
189 |
| -\end{libreqtab3} |
| 232 | + |
| 233 | +\pnum |
| 234 | +\returns |
| 235 | +Converts the character sequence designated by the iterator range |
| 236 | +\range{F1}{F2} into a value of a bitmask type that can |
| 237 | +subsequently be passed to \tcode{isctype}. |
| 238 | +Values returned from \tcode{lookup_classname} can be bitwise \logop{OR}'ed together; |
| 239 | +the resulting value represents membership |
| 240 | +in either of the corresponding character classes. |
| 241 | +If \tcode{b} is \tcode{true}, the returned bitmask is suitable for |
| 242 | +matching characters without regard to their case. |
| 243 | +Returns \tcode{0} |
| 244 | +if the character sequence is not the name of |
| 245 | +a character class recognized by \tcode{X}. |
| 246 | +The value returned shall be independent of |
| 247 | +the case of the characters in the sequence. |
| 248 | +\end{itemdescr} |
| 249 | + |
| 250 | +\begin{itemdecl} |
| 251 | +v.isctype(c, cl) |
| 252 | +\end{itemdecl} |
| 253 | + |
| 254 | +\begin{itemdescr} |
| 255 | +\pnum |
| 256 | +\returntype |
| 257 | +\tcode{bool} |
| 258 | + |
| 259 | +\pnum |
| 260 | +\returns |
| 261 | +Returns \tcode{true} if character \tcode{c} is a member of |
| 262 | +one of the character classes designated by \tcode{cl}, |
| 263 | +\tcode{false} otherwise. |
| 264 | +\end{itemdescr} |
| 265 | + |
| 266 | +\begin{itemdecl} |
| 267 | +v.value(c, I) |
| 268 | +\end{itemdecl} |
| 269 | + |
| 270 | +\begin{itemdescr} |
| 271 | +\pnum |
| 272 | +\returntype |
| 273 | +\tcode{int} |
| 274 | + |
| 275 | +\pnum |
| 276 | +\returns |
| 277 | +Returns the value represented by the digit \textit{c} in base |
| 278 | +\textit{I} if the character \textit{c} is a valid digit in base \textit{I}; |
| 279 | +otherwise returns \tcode{-1}. |
| 280 | +\begin{note} |
| 281 | +The value of \textit{I} will only be 8, 10, or 16. |
| 282 | +\end{note} |
| 283 | +\end{itemdescr} |
| 284 | + |
| 285 | +\begin{itemdecl} |
| 286 | +u.imbue(loc) |
| 287 | +\end{itemdecl} |
| 288 | + |
| 289 | +\begin{itemdescr} |
| 290 | +\pnum |
| 291 | +\returntype |
| 292 | +\tcode{X::locale_type} |
| 293 | + |
| 294 | +\indextext{locale}% |
| 295 | +\pnum |
| 296 | +\effects |
| 297 | +Imbues \tcode{u} with the locale \tcode{loc} and |
| 298 | +returns the previous locale used by \tcode{u} if any. |
| 299 | +\end{itemdescr} |
| 300 | + |
| 301 | +\begin{itemdecl} |
| 302 | +v.getloc() |
| 303 | +\end{itemdecl} |
| 304 | + |
| 305 | +\begin{itemdescr} |
| 306 | +\pnum |
| 307 | +\returntype |
| 308 | +\tcode{X::locale_type} |
| 309 | + |
| 310 | +\pnum |
| 311 | +\returns |
| 312 | +Returns the current locale used by \tcode{v}, if any. \indextext{locale}% |
| 313 | +\end{itemdescr} |
190 | 314 |
|
191 | 315 | \pnum
|
192 | 316 | \begin{note}
|
|
0 commit comments