| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title>Rationale</title> |
|---|
| 5 | <link rel="stylesheet" href="../boostbook.css" type="text/css"> |
|---|
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
|---|
| 7 | <link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
|---|
| 8 | <link rel="up" href="../string_algo.html" title="Chapter 14. Boost String Algorithms Library"> |
|---|
| 9 | <link rel="prev" href="../boost/algorithm/trim.html" title="Function template trim"> |
|---|
| 10 | <link rel="next" href="env.html" title="Environment"> |
|---|
| 11 | </head> |
|---|
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
|---|
| 13 | <table cellpadding="2" width="100%"> |
|---|
| 14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> |
|---|
| 15 | <td align="center"><a href="../../../index.htm">Home</a></td> |
|---|
| 16 | <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> |
|---|
| 17 | <td align="center"><a href="../../../people/people.htm">People</a></td> |
|---|
| 18 | <td align="center"><a href="../../../more/faq.htm">FAQ</a></td> |
|---|
| 19 | <td align="center"><a href="../../../more/index.htm">More</a></td> |
|---|
| 20 | </table> |
|---|
| 21 | <hr> |
|---|
| 22 | <div class="spirit-nav"> |
|---|
| 23 | <a accesskey="p" href="../boost/algorithm/trim.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="env.html"><img src="../images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="section" lang="en"> |
|---|
| 26 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
|---|
| 27 | <a name="string_algo.rationale"></a>Rationale</h2></div></div></div> |
|---|
| 28 | <div class="toc"><dl> |
|---|
| 29 | <dt><span class="section"><a href="rationale.html#id1709513">Locales</a></span></dt> |
|---|
| 30 | <dt><span class="section"><a href="rationale.html#string_algo.regex">Regular Expressions</a></span></dt> |
|---|
| 31 | </dl></div> |
|---|
| 32 | <div class="section" lang="en"> |
|---|
| 33 | <div class="titlepage"><div><div><h3 class="title"> |
|---|
| 34 | <a name="id1709513"></a>Locales</h3></div></div></div> |
|---|
| 35 | <p> |
|---|
| 36 | Locales have a very close relation to string processing. They contain information about |
|---|
| 37 | the character sets and are used, for example, to change the case of characters and |
|---|
| 38 | to classify the characters. |
|---|
| 39 | </p> |
|---|
| 40 | <p> |
|---|
| 41 | C++ allows to work with multiple different instances of locales at once. If an algorithm |
|---|
| 42 | manipulates some data in a way that requires the usage of locales, there must be a way |
|---|
| 43 | to specify them. However, one instance of locales is sufficient for most of the applications, |
|---|
| 44 | and for a user it could be very tedious to specify which locales to use at every place |
|---|
| 45 | where it is needed. |
|---|
| 46 | </p> |
|---|
| 47 | <p> |
|---|
| 48 | Fortunately, the C++ standard allows to specify the <span class="emphasis"><em>global</em></span> locales (using static member |
|---|
| 49 | function <code class="computeroutput">std:locale::global()</code>). When instantiating an |
|---|
| 50 | <code class="computeroutput">std::locale</code> class without explicit information, the instance will |
|---|
| 51 | be initialized with the <span class="emphasis"><em>global</em></span> locale. This implies, that if an algorithm needs a locale, |
|---|
| 52 | it should have an <code class="computeroutput">std::locale</code> parameter defaulting to <code class="computeroutput">std::locale()</code>. |
|---|
| 53 | If a user needs to specify locales explicitly, she can do so. Otherwise the <span class="emphasis"><em>global</em></span> |
|---|
| 54 | locales are used. |
|---|
| 55 | </p> |
|---|
| 56 | </div> |
|---|
| 57 | <div class="section" lang="en"> |
|---|
| 58 | <div class="titlepage"><div><div><h3 class="title"> |
|---|
| 59 | <a name="string_algo.regex"></a>Regular Expressions</h3></div></div></div> |
|---|
| 60 | <p> |
|---|
| 61 | Regular expressions are an essential part of text processing. For this reason, the library |
|---|
| 62 | also provides regex variants of some algorithms. The library does not attempt to replace |
|---|
| 63 | Boost.Regex; it merely wraps its functionality in a new interface. |
|---|
| 64 | As a part of this library, regex algorithms integrate smoothly with other components, which |
|---|
| 65 | brings additional value. |
|---|
| 66 | </p> |
|---|
| 67 | </div> |
|---|
| 68 | </div> |
|---|
| 69 | <table width="100%"><tr> |
|---|
| 70 | <td align="left"><small><p>Last revised: August 16, 2006 at 07:10:48 GMT</p></small></td> |
|---|
| 71 | <td align="right"><small>Copyright © 2002-2004 Pavol Droba</small></td> |
|---|
| 72 | </tr></table> |
|---|
| 73 | <hr> |
|---|
| 74 | <div class="spirit-nav"> |
|---|
| 75 | <a accesskey="p" href="../boost/algorithm/trim.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="env.html"><img src="../images/next.png" alt="Next"></a> |
|---|
| 76 | </div> |
|---|
| 77 | </body> |
|---|
| 78 | </html> |
|---|