regex_traits.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>regex_traits</title>
  5. <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../../index.html" title="Boost.Regex 5.1.4">
  8. <link rel="up" href="../ref.html" title="Reference">
  9. <link rel="prev" href="error_type.html" title="error_type">
  10. <link rel="next" href="non_std_strings.html" title="Interfacing With Non-Standard String Types">
  11. </head>
  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>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="error_type.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.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="non_std_strings.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h3 class="title">
  27. <a name="boost_regex.ref.regex_traits"></a><a class="link" href="regex_traits.html" title="regex_traits">regex_traits</a>
  28. </h3></div></div></div>
  29. <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span>
  30. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">implementationT</span> <span class="special">=</span> <span class="identifier">sensible_default_choice</span><span class="special">&gt;</span>
  31. <span class="keyword">struct</span> <span class="identifier">regex_traits</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">implementationT</span>
  32. <span class="special">{</span>
  33. <span class="identifier">regex_traits</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">implementationT</span><span class="special">()</span> <span class="special">{}</span>
  34. <span class="special">};</span>
  35. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">&gt;</span>
  36. <span class="keyword">struct</span> <span class="identifier">c_regex_traits</span><span class="special">;</span>
  37. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">&gt;</span>
  38. <span class="keyword">class</span> <span class="identifier">cpp_regex_traits</span><span class="special">;</span>
  39. <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">&gt;</span>
  40. <span class="keyword">class</span> <span class="identifier">w32_regex_traits</span><span class="special">;</span>
  41. <span class="special">}</span> <span class="comment">// namespace boost</span>
  42. </pre>
  43. <h5>
  44. <a name="boost_regex.ref.regex_traits.h0"></a>
  45. <span class="phrase"><a name="boost_regex.ref.regex_traits.description"></a></span><a class="link" href="regex_traits.html#boost_regex.ref.regex_traits.description">Description</a>
  46. </h5>
  47. <p>
  48. The class <code class="computeroutput"><span class="identifier">regex_traits</span></code> is
  49. just a thin wrapper around an actual implementation class, which may be one
  50. of:
  51. </p>
  52. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  53. <li class="listitem">
  54. <code class="computeroutput"><span class="identifier">c_regex_traits</span></code>: this
  55. class is deprecated, it wraps the C locale, and is used as the default
  56. implementation when the platform is not Win32, and the C++ locale is
  57. not available.
  58. </li>
  59. <li class="listitem">
  60. <code class="computeroutput"><span class="identifier">cpp_regex_traits</span></code>: the
  61. default traits class for non-Win32 platforms, allows the regex class
  62. to be imbued with a std::locale instance.
  63. </li>
  64. <li class="listitem">
  65. <code class="computeroutput"><span class="identifier">w32_regex_traits</span></code>: the
  66. default traits class implementation on Win32 platforms, allows the regex
  67. class to be imbued with an LCID.
  68. </li>
  69. </ul></div>
  70. <p>
  71. The default behavior can be altered by defining one of the following configuration
  72. macros in <a href="../../../../../../boost/regex/user.hpp" target="_top">boost/regex/user.hpp</a>
  73. </p>
  74. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  75. <li class="listitem">
  76. BOOST_REGEX_USE_C_LOCALE: makes <code class="computeroutput"><span class="identifier">c_regex_traits</span></code>
  77. the default.
  78. </li>
  79. <li class="listitem">
  80. BOOST_REGEX_USE_CPP_LOCALE: makes <code class="computeroutput"><span class="identifier">cpp_regex_traits</span></code>
  81. the default.
  82. </li>
  83. </ul></div>
  84. <p>
  85. All these traits classes fulfil the <a class="link" href="concepts/traits_concept.html" title="Traits Class Requirements">traits
  86. class requirements</a>.
  87. </p>
  88. </div>
  89. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  90. <td align="left"></td>
  91. <td align="right"><div class="copyright-footer">Copyright &#169; 1998-2013 John Maddock<p>
  92. Distributed under the Boost Software License, Version 1.0. (See accompanying
  93. 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>)
  94. </p>
  95. </div></td>
  96. </tr></table>
  97. <hr>
  98. <div class="spirit-nav">
  99. <a accesskey="p" href="error_type.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.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="non_std_strings.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  100. </div>
  101. </body>
  102. </html>