3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Traits Class Requirements
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../../index.html" title=
"Boost.Regex 5.1.2">
8 <link rel=
"up" href=
"../concepts.html" title=
"Concepts">
9 <link rel=
"prev" href=
"charT_concept.html" title=
"charT Requirements">
10 <link rel=
"next" href=
"iterator_concepts.html" title=
"Iterator Requirements">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../../../libs/libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"charT_concept.html"><img src=
"../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../concepts.html"><img src=
"../../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../../index.html"><img src=
"../../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"iterator_concepts.html"><img src=
"../../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h4 class=
"title">
27 <a name=
"boost_regex.ref.concepts.traits_concept"></a><a class=
"link" href=
"traits_concept.html" title=
"Traits Class Requirements">Traits Class
29 </h4></div></div></div>
31 There are two sets of requirements for the
<code class=
"computeroutput"><span class=
"identifier">traits
</span></code>
32 template argument to
<a class=
"link" href=
"../basic_regex.html" title=
"basic_regex"><code class=
"computeroutput"><span class=
"identifier">basic_regex
</span></code></a>: a minimal interface
33 (which is part of the regex standardization proposal), and an optional
34 Boost-specific enhanced interface.
37 <a name=
"boost_regex.ref.concepts.traits_concept.h0"></a>
38 <span class=
"phrase"><a name=
"boost_regex.ref.concepts.traits_concept.minimal_requirements"></a></span><a class=
"link" href=
"traits_concept.html#boost_regex.ref.concepts.traits_concept.minimal_requirements">Minimal
42 In the following table
<code class=
"computeroutput"><span class=
"identifier">X
</span></code>
43 denotes a traits class defining types and functions for the character container
44 type
<code class=
"computeroutput"><span class=
"identifier">charT
</span></code>;
<span class=
"emphasis"><em>u
</em></span>
45 is an object of type
<code class=
"computeroutput"><span class=
"identifier">X
</span></code>;
46 <span class=
"emphasis"><em>v
</em></span> is an object of type
<code class=
"computeroutput"><span class=
"keyword">const
</span>
47 <span class=
"identifier">X
</span></code>;
<span class=
"emphasis"><em>p
</em></span> is
48 a value of type
<code class=
"computeroutput"><span class=
"keyword">const
</span> <span class=
"identifier">charT
</span><span class=
"special">*
</span></code>;
<span class=
"emphasis"><em>I1
</em></span> and
<span class=
"emphasis"><em>I2
</em></span>
49 are Input Iterators;
<span class=
"emphasis"><em>c
</em></span> is a value of type
<code class=
"computeroutput"><span class=
"keyword">const
</span> <span class=
"identifier">charT
</span></code>;
50 <span class=
"emphasis"><em>s
</em></span> is an object of type
<code class=
"computeroutput"><span class=
"identifier">X
</span><span class=
"special">::
</span><span class=
"identifier">string_type
</span></code>;
51 <span class=
"emphasis"><em>cs
</em></span> is an object of type
<code class=
"computeroutput"><span class=
"keyword">const
</span>
52 <span class=
"identifier">X
</span><span class=
"special">::
</span><span class=
"identifier">string_type
</span></code>;
<span class=
"emphasis"><em>b
</em></span> is
53 a value of type
<code class=
"computeroutput"><span class=
"keyword">bool
</span></code>;
<span class=
"emphasis"><em>I
</em></span>
54 is a value of type
<code class=
"computeroutput"><span class=
"keyword">int
</span></code>;
<span class=
"emphasis"><em>F1
</em></span>
55 and
<span class=
"emphasis"><em>F2
</em></span> are values of type
<code class=
"computeroutput"><span class=
"keyword">const
</span>
56 <span class=
"identifier">charT
</span><span class=
"special">*
</span></code>;
57 and
<span class=
"emphasis"><em>loc
</em></span> is an object of type
<code class=
"computeroutput"><span class=
"identifier">X
</span><span class=
"special">::
</span><span class=
"identifier">locale_type
</span></code>.
59 <div class=
"informaltable"><table class=
"table">
78 Assertion / Note Pre / Post condition
96 The character container type used in the implementation of class
111 An unsigned integer type, capable of holding the length of a
112 null-terminated string of charT's.
124 std::basic_string
<charT
> or std::vector
<charT
>
138 Implementation defined
143 A copy constructible type that represents the locale used by
156 Implementation defined
161 A bitmask type representing a particular character classification.
162 Multiple values of this type can be bitwise-or'ed together to
163 obtain a new valid value.
180 Yields the smallest i such that p[i] ==
0. Complexity is linear
198 Returns a character such that for any character d that is to
199 be considered equivalent to c then v.translate(c) == v.translate(d).
206 v.translate_nocase(c)
216 For all characters C that are to be considered equivalent to
217 c when comparisons are to be performed without regard to case,
218 then v.translate_nocase(c) == v.translate_nocase(C).
235 Returns a sort key for the character sequence designated by the
236 iterator range [F1, F2) such that if the character sequence [G1,
237 G2) sorts before the character sequence [H1, H2) then v.transform(G1,
238 G2)
< v.transform(H1, H2).
245 v.transform_primary(F1, F2)
255 Returns a sort key for the character sequence designated by the
256 iterator range [F1, F2) such that if the character sequence [G1,
257 G2) sorts before the character sequence [H1, H2) when character
258 case is not considered then v.transform_primary(G1, G2)
<
259 v.transform_primary(H1, H2).
266 v.lookup_classname(F1, F2)
276 Converts the character sequence designated by the iterator range
277 [F1,F2) into a bitmask type that can subsequently be passed to
278 isctype. Values returned from lookup_classname can be safely
279 bitwise or'ed together. Returns
0 if the character sequence is
280 not the name of a character class recognized by X. The value
281 returned shall be independent of the case of the characters in
289 v.lookup_collatename(F1, F2)
299 Returns a sequence of characters that represents the collating
300 element consisting of the character sequence designated by the
301 iterator range [F1, F2). Returns an empty string if the character
302 sequence is not a valid collating element.
309 v.isctype(c, v.lookup_classname (F1, F2))
319 Returns true if character c is a member of the character class
320 designated by the iterator range [F1, F2), false otherwise.
337 Returns the value represented by the digit c in base I if the
338 character c is a valid digit in base I; otherwise returns -
1.
339 [Note: the value of I will only be
8,
10, or
16. -end note]
356 Imbues u with the locale loc, returns the previous locale used
374 Returns the current locale used by v if any.
381 <a name=
"boost_regex.ref.concepts.traits_concept.h1"></a>
382 <span class=
"phrase"><a name=
"boost_regex.ref.concepts.traits_concept.additional_optional_requirements"></a></span><a class=
"link" href=
"traits_concept.html#boost_regex.ref.concepts.traits_concept.additional_optional_requirements">Additional
383 Optional Requirements
</a>
386 The following additional requirements are strictly optional, however in
387 order for
<a class=
"link" href=
"../basic_regex.html" title=
"basic_regex"><code class=
"computeroutput"><span class=
"identifier">basic_regex
</span></code></a>
388 to take advantage of these additional interfaces, all of the following
389 requirements must be met;
<a class=
"link" href=
"../basic_regex.html" title=
"basic_regex"><code class=
"computeroutput"><span class=
"identifier">basic_regex
</span></code></a> will detect the presence
390 or absence of the member
<code class=
"computeroutput"><span class=
"identifier">boost_extensions_tag
</span></code>
391 and configure itself appropriately.
393 <div class=
"informaltable"><table class=
"table">
412 Assertion / Note Pre / Post condition
420 X::boost_extensions_tag
430 When present, all of the extensions listed in this table must
443 regex_constants::syntax_type
448 Returns a symbolic value of type regex_constants::syntax_type
449 that signifies the meaning of character c within the regular
457 v.escape_syntax_type(c)
462 regex_constants::escape_syntax_type
467 Returns a symbolic value of type regex_constants::escape_syntax_type,
468 that signifies the meaning of character c within the regular
469 expression grammar, when c has been preceded by an escape character.
470 Precondition: if b is the character preceding c in the expression
471 being parsed then:
<code class=
"computeroutput"><span class=
"identifier">v
</span><span class=
"special">.
</span><span class=
"identifier">syntax_type
</span><span class=
"special">(
</span><span class=
"identifier">b
</span><span class=
"special">)
</span> <span class=
"special">==
</span>
472 <span class=
"identifier">syntax_escape
</span></code>
489 Returns a character d such that: for any character d that is
490 to be considered equivalent to c then
<code class=
"computeroutput"><span class=
"identifier">v
</span><span class=
"special">.
</span><span class=
"identifier">translate
</span><span class=
"special">(
</span><span class=
"identifier">c
</span><span class=
"special">,
</span><span class=
"keyword">false
</span><span class=
"special">)==
</span><span class=
"identifier">v
</span><span class=
"special">.
</span><span class=
"identifier">translate
</span><span class=
"special">(
</span><span class=
"identifier">d
</span><span class=
"special">,
</span><span class=
"keyword">false
</span><span class=
"special">)
</span></code>. Likewise for all characters
491 C that are to be considered equivalent to c when comparisons
492 are to be performed without regard to case, then
<code class=
"computeroutput"><span class=
"identifier">v
</span><span class=
"special">.
</span><span class=
"identifier">translate
</span><span class=
"special">(
</span><span class=
"identifier">c
</span><span class=
"special">,
</span><span class=
"keyword">true
</span><span class=
"special">)==
</span><span class=
"identifier">v
</span><span class=
"special">.
</span><span class=
"identifier">translate
</span><span class=
"special">(
</span><span class=
"identifier">C
</span><span class=
"special">,
</span><span class=
"keyword">true
</span><span class=
"special">)
</span></code>.
504 An integer type capable of holding either a charT or an int.
509 Behaves as follows: if
<code class=
"computeroutput"><span class=
"identifier">p
</span>
510 <span class=
"special">==
</span> <span class=
"identifier">q
</span></code>
511 or if
<code class=
"computeroutput"><span class=
"special">*
</span><span class=
"identifier">p
</span></code>
512 is not a digit character then returns -
1. Otherwise performs
513 formatted numeric input on the sequence [p,q) and returns the
514 result as an int. Postcondition: either p == q or *p is a non-digit
532 Returns a human readable error string for the error condition
533 i, where i is one of the values enumerated by type regex_constants::error_type.
534 If the value
<span class=
"emphasis"><em>I
</em></span> is not recognized then returns
535 the string
"Unknown error" or a localized equivalent.
552 Converts c to lower case, used for Perl-style \l and \L formatting
570 Converts c to upper case, used for Perl-style \u and \U formatting
578 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
579 <td align=
"left"></td>
580 <td align=
"right"><div class=
"copyright-footer">Copyright
© 1998-
2013 John Maddock
<p>
581 Distributed under the Boost Software License, Version
1.0. (See accompanying
582 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
587 <div class=
"spirit-nav">
588 <a accesskey=
"p" href=
"charT_concept.html"><img src=
"../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../concepts.html"><img src=
"../../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../../index.html"><img src=
"../../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"iterator_concepts.html"><img src=
"../../../../../../../doc/src/images/next.png" alt=
"Next"></a>