blob: 255539ab5b24c522f2caa4723c7482b098625b03 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Boost.Locale: boost::locale::util Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="boost-small.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Boost.Locale
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="namespaces.html"><span>Namespace&#160;List</span></a></li>
<li><a href="namespacemembers.html"><span>Namespace&#160;Members</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('namespaceboost_1_1locale_1_1util.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">boost::locale::util Namespace Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This namespace provides various utility function useful for Boost.Locale backends implementations.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point. <a href="classboost_1_1locale_1_1util_1_1base__converter.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost_1_1locale_1_1util.html#ad9737569d0e2d6b08885b01aba308365">get_system_locale</a> (bool use_utf8_on_windows=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return default system locale name in POSIX format. <a href="#ad9737569d0e2d6b08885b01aba308365"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::locale&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost_1_1locale_1_1util.html#a8322299021a4af3cdbb8b31e775e77f4">create_info</a> (std::locale const &amp;in, std::string const &amp;name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Installs information facet to locale in based on locale name <em>name</em>. <a href="#a8322299021a4af3cdbb8b31e775e77f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::auto_ptr&lt; <a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost_1_1locale_1_1util.html#aa8e8480ddadc3e972aeb4d468446db64">create_utf8_converter</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::auto_ptr&lt; <a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost_1_1locale_1_1util.html#a79624ad8d782ad41d5edf90b6c830631">create_simple_converter</a> (std::string const &amp;encoding)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::locale&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost_1_1locale_1_1util.html#a3e6728910dc947c3062c6bfd28b70fc4">create_codecvt</a> (std::locale const &amp;in, std::auto_ptr&lt; <a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a> &gt; cvt, <a class="el" href="namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type</a> type)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This namespace provides various utility function useful for Boost.Locale backends implementations. </p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a3e6728910dc947c3062c6bfd28b70fc4"></a><!-- doxytag: member="boost::locale::util::create_codecvt" ref="a3e6728910dc947c3062c6bfd28b70fc4" args="(std::locale const &amp;in, std::auto_ptr&lt; base_converter &gt; cvt, character_facet_type type)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale <a class="el" href="namespaceboost_1_1locale_1_1util.html#a3e6728910dc947c3062c6bfd28b70fc4">boost::locale::util::create_codecvt</a> </td>
<td>(</td>
<td class="paramtype">std::locale const &amp;&#160;</td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::auto_ptr&lt; base_converter &gt;&#160;</td>
<td class="paramname"><em>cvt</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">character_facet_type&#160;</td>
<td class="paramname"><em>type</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Install codecvt facet into locale <em>in</em> and return new locale that is based on <em>in</em> and uses new facet.</p>
<p>codecvt facet would convert between narrow and wide/char16_t/char32_t encodings using <em>cvt</em> converter. If <em>cvt</em> is null pointer, always failure conversion would be used that fails on every first input or output.</p>
<p>Note: the codecvt facet handles both UTF-16 and UTF-32 wide encodings, it knows to break and join Unicode code-points above 0xFFFF to and from surrogate pairs correctly. <em>cvt</em> should be unaware of wide encoding type </p>
</div>
</div>
<a class="anchor" id="a8322299021a4af3cdbb8b31e775e77f4"></a><!-- doxytag: member="boost::locale::util::create_info" ref="a8322299021a4af3cdbb8b31e775e77f4" args="(std::locale const &amp;in, std::string const &amp;name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale <a class="el" href="namespaceboost_1_1locale_1_1util.html#a8322299021a4af3cdbb8b31e775e77f4">boost::locale::util::create_info</a> </td>
<td>(</td>
<td class="paramtype">std::locale const &amp;&#160;</td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string const &amp;&#160;</td>
<td class="paramname"><em>name</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Installs information facet to locale in based on locale name <em>name</em>. </p>
<p>This function installs <a class="el" href="classboost_1_1locale_1_1info.html" title="a facet that holds general information about locale">boost::locale::info</a> facet into the locale <em>in</em> and returns newly created locale.</p>
<p>Note: all information is based only on parsing of string <em>name</em>;</p>
<p>The name has following format: language[_COUNTRY][.encoding][@variant] Where language is ISO-639 language code like "en" or "ru", COUNTRY is ISO-3166 country identifier like "US" or "RU". the Encoding is a charracter set name like UTF-8 or ISO-8859-1. Variant is backend specific variant like <code>euro</code> or calendar=hebrew.</p>
<p>If some parameters are missing they are specified as blanks, default encoding is assumed to be US-ASCII and missing language is assumed to be "C" </p>
</div>
</div>
<a class="anchor" id="a79624ad8d782ad41d5edf90b6c830631"></a><!-- doxytag: member="boost::locale::util::create_simple_converter" ref="a79624ad8d782ad41d5edf90b6c830631" args="(std::string const &amp;encoding)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::auto_ptr&lt;<a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a>&gt; <a class="el" href="namespaceboost_1_1locale_1_1util.html#a79624ad8d782ad41d5edf90b6c830631">boost::locale::util::create_simple_converter</a> </td>
<td>(</td>
<td class="paramtype">std::string const &amp;&#160;</td>
<td class="paramname"><em>encoding</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function creates a <em><a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html" title="This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point...">base_converter</a></em> that can be used for conversion between single byte character encodings like ISO-8859-1, koi8-r, windows-1255 and Unicode code points,</p>
<p>If <em>encoding</em> is not supported, empty pointer is returned. You should check if std::auto_ptr&lt;base_converter&gt;::get() != 0 </p>
</div>
</div>
<a class="anchor" id="aa8e8480ddadc3e972aeb4d468446db64"></a><!-- doxytag: member="boost::locale::util::create_utf8_converter" ref="aa8e8480ddadc3e972aeb4d468446db64" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::auto_ptr&lt;<a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html">base_converter</a>&gt; <a class="el" href="namespaceboost_1_1locale_1_1util.html#aa8e8480ddadc3e972aeb4d468446db64">boost::locale::util::create_utf8_converter</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function creates a <em><a class="el" href="classboost_1_1locale_1_1util_1_1base__converter.html" title="This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point...">base_converter</a></em> that can be used for conversion between UTF-8 and unicode code points </p>
</div>
</div>
<a class="anchor" id="ad9737569d0e2d6b08885b01aba308365"></a><!-- doxytag: member="boost::locale::util::get_system_locale" ref="ad9737569d0e2d6b08885b01aba308365" args="(bool use_utf8_on_windows=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string <a class="el" href="namespaceboost_1_1locale_1_1util.html#ad9737569d0e2d6b08885b01aba308365">boost::locale::util::get_system_locale</a> </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>use_utf8_on_windows</em> = <code>false</code></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return default system locale name in POSIX format. </p>
<p>This function tries to detect the locale using, LC_CTYPE, LC_ALL and LANG environment variables in this order and if all of them unset, in POSIX platforms it returns "C"</p>
<p>On Windows additionally to check the above environment variables, this function tries to creates locale name from ISO-339 and ISO-3199 country codes defined for user default locale. If <em>use_utf8_on_windows</em> is true it sets the encoding to UTF-8, otherwise, if system locale supports ANSI code-page it defines the ANSI encoding like windows-1252, otherwise it fall-backs to UTF-8 encoding if ANSI code-page is not available. </p>
</div>
</div>
</div><!-- contents -->
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>boost</b> </li>
<li class="navelem"><a class="el" href="namespaceboost_1_1locale.html">locale</a> </li>
<li class="navelem"><a class="el" href="namespaceboost_1_1locale_1_1util.html">util</a> </li>
<li class="footer">
&copy; Copyright 2009-2012 Artyom Beilis, Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a>, Version 1.0.
</li>
</ul>
</div>
</body>
</html>