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