]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright 2006-2007 John Maddock. | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt). | |
6 | ] | |
7 | ||
8 | ||
9 | [section:regex_traits regex_traits] | |
10 | ||
11 | namespace boost{ | |
12 | ||
13 | template <class charT, class implementationT = sensible_default_choice> | |
14 | struct regex_traits : public implementationT | |
15 | { | |
16 | regex_traits() : implementationT() {} | |
17 | }; | |
18 | ||
19 | template <class charT> | |
20 | struct c_regex_traits; | |
21 | ||
22 | template <class charT> | |
23 | class cpp_regex_traits; | |
24 | ||
25 | template <class charT> | |
26 | class w32_regex_traits; | |
27 | ||
28 | } // namespace boost | |
29 | ||
30 | [h4 Description] | |
31 | ||
32 | The class `regex_traits` is just a thin wrapper around an actual implementation | |
33 | class, which may be one of: | |
34 | ||
35 | * `c_regex_traits`: this class is deprecated, it wraps the C locale, and is used as the default implementation when the platform is not Win32, and the C++ locale is not available. | |
36 | * `cpp_regex_traits`: the default traits class for non-Win32 platforms, allows the regex class to be imbued with a std::locale instance. | |
37 | * `w32_regex_traits`: the default traits class implementation on Win32 platforms, allows the regex class to be imbued with an LCID. | |
38 | ||
39 | The default behavior can be altered by defining one of the following | |
40 | configuration macros in | |
41 | [@../../../../boost/regex/user.hpp boost/regex/user.hpp] | |
42 | ||
43 | * BOOST_REGEX_USE_C_LOCALE: makes `c_regex_traits` the default. | |
44 | * BOOST_REGEX_USE_CPP_LOCALE: makes `cpp_regex_traits` the default. | |
45 | ||
46 | All these traits classes fulfil the | |
47 | [link boost_regex.ref.concepts.traits_concept traits class requirements]. | |
48 | ||
49 | [endsect] | |
50 |