Skip to content

Commit 408a22b

Browse files
jensmaurertkoeppe
authored andcommitted
[re.req] Replace requirements table with \itemdescr
1 parent 0539c5e commit 408a22b

File tree

1 file changed

+268
-115
lines changed

1 file changed

+268
-115
lines changed

source/regex.tex

Lines changed: 268 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -63,130 +63,283 @@
6363
\indextext{requirements!regular expression traits}%
6464
\indextext{regular expression!requirements}%
6565
\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
7280
\tcode{F1} and \tcode{F2} are forward iterators\iref{forward.iterators};
81+
\item
7382
\tcode{c} is a value of type \tcode{const charT};
83+
\item
7484
\tcode{s} is an object of type \tcode{X::string_type};
85+
\item
7586
\tcode{cs} is an object of type \tcode{const X::string_type};
87+
\item
7688
\tcode{b} is a value of type \tcode{bool};
89+
\item
7790
\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{itemdecl}
103+
typename X::char_type
104+
\end{itemdecl}
105+
106+
\begin{itemdescr}
107+
\pnum
108+
\result
109+
\tcode{charT},
110+
the character container type used in the implementation of class
111+
template \tcode{basic_regex}.
112+
\end{itemdescr}
113+
114+
\begin{itemdecl}
115+
typename X::string_type
116+
\end{itemdecl}
117+
118+
\begin{itemdescr}
119+
\pnum
120+
\result
121+
\tcode{basic_string<charT>}
122+
\end{itemdescr}
123+
124+
\begin{itemdecl}
125+
typename X::locale_type
126+
\end{itemdecl}
127+
128+
\begin{itemdescr}
129+
\pnum
130+
\result
131+
A copy constructible type
132+
that represents the locale used by the traits class.
133+
\end{itemdescr}
134+
135+
\begin{itemdecl}
136+
typename X::char_class_type
137+
\end{itemdecl}
138+
139+
\begin{itemdescr}
140+
\pnum
141+
\result
142+
A bitmask type\iref{bitmask.types}
143+
representing a particular character classification.
144+
\end{itemdescr}
145+
146+
\begin{itemdecl}
147+
X::length(p)
148+
\end{itemdecl}
149+
150+
\begin{itemdescr}
151+
\pnum
152+
\result
153+
\tcode{size_t}
154+
155+
\pnum
156+
\returns
157+
The smallest \tcode{i} such that \tcode{p[i] == 0}.
158+
159+
\pnum
160+
\complexity
161+
Linear in \tcode{i}.
162+
\end{itemdescr}
163+
164+
\begin{itemdecl}
165+
v.translate(c)
166+
\end{itemdecl}
167+
168+
\begin{itemdescr}
169+
\pnum
170+
\result
92171
\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
172+
173+
\pnum
174+
\returns
175+
A character such that for any character \tcode{d}
176+
that is to be considered equivalent to \tcode{c}
177+
then \tcode{v.translate(c) == v.translate(d)}.
178+
\end{itemdescr}
179+
180+
\begin{itemdecl}
181+
v.translate_nocase(c)
182+
\end{itemdecl}
183+
184+
\begin{itemdescr}
185+
\pnum
186+
\result
187+
\tcode{X::char_type}
188+
189+
\pnum
190+
\returns
191+
For all characters \tcode{C} that are to be considered equivalent to \tcode{c}
192+
when comparisons are to be performed without regard to case,
193+
then \tcode{v.translate_nocase(c) == v.translate_nocase(C)}.
194+
\end{itemdescr}
195+
196+
\begin{itemdecl}
197+
v.transform(F1, F2)
198+
\end{itemdecl}
199+
200+
\begin{itemdescr}
201+
\pnum
202+
\result
97203
\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
204+
205+
\pnum
206+
\returns
207+
A sort key for the character sequence designated by
208+
the iterator range \range{F1}{F2} such that
209+
if the character sequence \range{G1}{G2} sorts before
210+
the character sequence \range{H1}{H2}
211+
then \tcode{v.transform(G1, G2) < v.transform(H1, H2)}.
212+
\end{itemdescr}
213+
214+
\begin{itemdecl}
215+
v.transform_primary(F1, F2)
216+
\end{itemdecl}
217+
218+
\begin{itemdescr}
219+
\pnum
220+
\indextext{regular expression traits!\idxcode{transform_primary}}%
221+
\indextext{transform_primary@\tcode{transform_primary}!regular expression traits}%
222+
\result
223+
\tcode{X::string_type}
224+
225+
\pnum
226+
\returns
227+
A sort key for the character sequence designated by
228+
the iterator range \range{F1}{F2} such that
229+
if the character sequence \range{G1}{G2} sorts before
230+
the character sequence \range{H1}{H2}
231+
when character case is not considered
232+
then \tcode{v.transform_primary(G1, G2) < v.transform_primary(H1, H2)}.
233+
\end{itemdescr}
234+
235+
\begin{itemdecl}
236+
v.lookup_collatename(F1, F2)
237+
\end{itemdecl}
238+
239+
\begin{itemdescr}
240+
\pnum
241+
\result
242+
\tcode{X::string_type}
243+
244+
\pnum
245+
\returns
246+
A sequence of characters that represents the collating element
247+
consisting of the character sequence designated by
248+
the iterator range \range{F1}{F2}.
249+
Returns an empty string
250+
if the character sequence is not a valid collating element.
251+
\end{itemdescr}
252+
253+
\begin{itemdecl}
254+
v.lookup_classname(F1, F2, b)
255+
\end{itemdecl}
256+
257+
\begin{itemdescr}
258+
\pnum
259+
\result
105260
\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}
261+
262+
\pnum
263+
\returns
264+
Converts the character sequence designated by the iterator range
265+
\range{F1}{F2} into a value of a bitmask type that can
266+
subsequently be passed to \tcode{isctype}.
267+
Values returned from \tcode{lookup_classname} can be bitwise \logop{OR}'ed together;
268+
the resulting value represents membership
269+
in either of the corresponding character classes.
270+
If \tcode{b} is \tcode{true}, the returned bitmask is suitable for
271+
matching characters without regard to their case.
272+
Returns \tcode{0}
273+
if the character sequence is not the name of
274+
a character class recognized by \tcode{X}.
275+
The value returned shall be independent of
276+
the case of the characters in the sequence.
277+
\end{itemdescr}
278+
279+
\begin{itemdecl}
280+
v.isctype(c, cl)
281+
\end{itemdecl}
282+
283+
\begin{itemdescr}
284+
\pnum
285+
\result
286+
\tcode{bool}
287+
288+
\pnum
289+
\returns
290+
Returns \tcode{true} if character \tcode{c} is a member of
291+
one of the character classes designated by \tcode{cl},
292+
\tcode{false} otherwise.
293+
\end{itemdescr}
294+
295+
\begin{itemdecl}
296+
v.value(c, I)
297+
\end{itemdecl}
298+
299+
\begin{itemdescr}
300+
\pnum
301+
\result
302+
\tcode{int}
303+
304+
\pnum
305+
\returns
306+
Returns the value represented by the digit \textit{c} in base
307+
\textit{I} if the character \textit{c} is a valid digit in base \textit{I};
308+
otherwise returns \tcode{-1}.
309+
\begin{note}
310+
The value of \textit{I} will only be 8, 10, or 16.
311+
\end{note}
312+
\end{itemdescr}
313+
314+
\begin{itemdecl}
315+
u.imbue(loc)
316+
\end{itemdecl}
317+
318+
\begin{itemdescr}
319+
\pnum
320+
\result
321+
\tcode{X::locale_type}
322+
323+
\indextext{locale}%
324+
\pnum
325+
\effects
326+
Imbues \tcode{u} with the locale \tcode{loc} and
327+
returns the previous locale used by \tcode{u} if any.
328+
\end{itemdescr}
329+
330+
\begin{itemdecl}
331+
v.getloc()
332+
\end{itemdecl}
333+
334+
\begin{itemdescr}
335+
\pnum
336+
\result
337+
\tcode{X::locale_type}
338+
339+
\pnum
340+
\returns
341+
Returns the current locale used by \tcode{v}, if any. \indextext{locale}%
342+
\end{itemdescr}
190343

191344
\pnum
192345
\begin{note}

0 commit comments

Comments
 (0)