locale/doc/html/namespaceboost_1_1locale_1_1util.html
2015-10-18 17:31:48 +03:00

301 lines
17 KiB
HTML

<!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"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Boost.Locale: boost::locale::util Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<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>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</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><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){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 class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><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 class="memdesc:"><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 class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad9737569d0e2d6b08885b01aba308365"><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 class="memdesc:ad9737569d0e2d6b08885b01aba308365"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return default system locale name in POSIX format. <a href="#ad9737569d0e2d6b08885b01aba308365">More...</a><br/></td></tr>
<tr class="separator:ad9737569d0e2d6b08885b01aba308365"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8322299021a4af3cdbb8b31e775e77f4"><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 class="memdesc:a8322299021a4af3cdbb8b31e775e77f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Installs information facet to locale in based on locale name <em>name</em>. <a href="#a8322299021a4af3cdbb8b31e775e77f4">More...</a><br/></td></tr>
<tr class="separator:a8322299021a4af3cdbb8b31e775e77f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8e8480ddadc3e972aeb4d468446db64"><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 class="separator:aa8e8480ddadc3e972aeb4d468446db64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79624ad8d782ad41d5edf90b6c830631"><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 class="separator:a79624ad8d782ad41d5edf90b6c830631"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e6728910dc947c3062c6bfd28b70fc4"><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>
<tr class="separator:a3e6728910dc947c3062c6bfd28b70fc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedf56793c0804295e06cf97300b991f8"><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#aedf56793c0804295e06cf97300b991f8">create_utf8_codecvt</a> (std::locale const &amp;in, <a class="el" href="namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type</a> type)</td></tr>
<tr class="separator:aedf56793c0804295e06cf97300b991f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a674c01466528780b9076a191e84e05fa"><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#a674c01466528780b9076a191e84e05fa">create_simple_codecvt</a> (std::locale const &amp;in, std::string const &amp;encoding, <a class="el" href="namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type</a> type)</td></tr>
<tr class="separator:a674c01466528780b9076a191e84e05fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This namespace provides various utility function useful for Boost.Locale backends implementations. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3e6728910dc947c3062c6bfd28b70fc4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale boost::locale::util::create_codecvt </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>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale boost::locale::util::create_info </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="a674c01466528780b9076a191e84e05fa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale boost::locale::util::create_simple_codecvt </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>encoding</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>This function installs codecvt 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>Throws <a class="el" href="classboost_1_1locale_1_1conv_1_1invalid__charset__error.html" title="This exception is thrown in case of use of unsupported or invalid character set. ">boost::locale::conv::invalid_charset_error</a> if the chacater set is not supported or isn't single byte character set </p>
</div>
</div>
<a class="anchor" id="a79624ad8d782ad41d5edf90b6c830631"></a>
<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; boost::locale::util::create_simple_converter </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="aedf56793c0804295e06cf97300b991f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::locale boost::locale::util::create_utf8_codecvt </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">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 utf8 codecvt to UTF-16 or UTF-32 into locale <em>in</em> and return new locale that is based on <em>in</em> and uses new facet. </p>
</div>
</div>
<a class="anchor" id="aa8e8480ddadc3e972aeb4d468446db64"></a>
<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; boost::locale::util::create_utf8_converter </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>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string boost::locale::util::get_system_locale </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><!-- doc-content -->
<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>