<!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::utf::utf_traits&lt; CharType, size &gt; Struct Template 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><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><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="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#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('structboost_1_1locale_1_1utf_1_1utf__traits.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="structboost_1_1locale_1_1utf_1_1utf__traits-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">boost::locale::utf::utf_traits&lt; CharType, size &gt; Struct Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>UTF Traits class - functions to convert UTF sequences to and from Unicode code points.  
 <a href="structboost_1_1locale_1_1utf_1_1utf__traits.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="utf_8hpp_source.html">boost/locale/utf.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:accca9dc2d8fe018b9b5640c48e3470e4"><td class="memItemLeft" align="right" valign="top">typedef CharType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a></td></tr>
<tr class="separator:accca9dc2d8fe018b9b5640c48e3470e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9b6b01fa6705ba67ac78359ddee03213"><td class="memTemplParams" colspan="2">template&lt;typename Iterator &gt; </td></tr>
<tr class="memitem:a9b6b01fa6705ba67ac78359ddee03213"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#a9b6b01fa6705ba67ac78359ddee03213">decode</a> (Iterator &amp;p, Iterator e)</td></tr>
<tr class="separator:a9b6b01fa6705ba67ac78359ddee03213"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26c106ec8816f48431f882017ab46763"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#a26c106ec8816f48431f882017ab46763">width</a> (<a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a> value)</td></tr>
<tr class="separator:a26c106ec8816f48431f882017ab46763"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a6b72ba87a817652f522018df51a9a7"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#a8a6b72ba87a817652f522018df51a9a7">trail_length</a> (<a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a> c)</td></tr>
<tr class="separator:a8a6b72ba87a817652f522018df51a9a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2cb78fcb8a58bed3e0ce1d6528a719a"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#ae2cb78fcb8a58bed3e0ce1d6528a719a">is_trail</a> (<a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a> c)</td></tr>
<tr class="separator:ae2cb78fcb8a58bed3e0ce1d6528a719a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19789c4c26c8d9f576de5272f3d41a11"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#a19789c4c26c8d9f576de5272f3d41a11">is_lead</a> (<a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a> c)</td></tr>
<tr class="separator:a19789c4c26c8d9f576de5272f3d41a11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd59f628af084f800f8a86cdd8124fd8"><td class="memTemplParams" colspan="2">template&lt;typename Iterator &gt; </td></tr>
<tr class="memitem:acd59f628af084f800f8a86cdd8124fd8"><td class="memTemplItemLeft" align="right" valign="top">static Iterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#acd59f628af084f800f8a86cdd8124fd8">encode</a> (<a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a> value, Iterator out)</td></tr>
<tr class="separator:acd59f628af084f800f8a86cdd8124fd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ff625b2c19b0d4132f7ec9e6303cb36"><td class="memTemplParams" colspan="2">template&lt;typename Iterator &gt; </td></tr>
<tr class="memitem:a8ff625b2c19b0d4132f7ec9e6303cb36"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#a8ff625b2c19b0d4132f7ec9e6303cb36">decode_valid</a> (Iterator &amp;p)</td></tr>
<tr class="separator:a8ff625b2c19b0d4132f7ec9e6303cb36"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:abb4cb63a924d19505c2cb6e930c68a13"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#abb4cb63a924d19505c2cb6e930c68a13">max_width</a></td></tr>
<tr class="separator:abb4cb63a924d19505c2cb6e930c68a13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename CharType, int size = sizeof(CharType)&gt;<br/>
struct boost::locale::utf::utf_traits&lt; CharType, size &gt;</h3>

<p>UTF Traits class - functions to convert UTF sequences to and from Unicode code points. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="accca9dc2d8fe018b9b5640c48e3470e4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef CharType <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::<a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The type of the character </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a9b6b01fa6705ba67ac78359ddee03213"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<div class="memtemplate">
template&lt;typename Iterator &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a> <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::decode </td>
          <td>(</td>
          <td class="paramtype">Iterator &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Iterator&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Read one code point from the range [p,e) and return it.</p>
<ul>
<li>If the sequence that was read is incomplete sequence returns <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a20dbe458fd18229a0e6c09888d031b38">incomplete</a>,</li>
<li>If illegal sequence detected returns <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a30010000878c7732340bda8956b844fb">illegal</a></li>
</ul>
<p>Requirements</p>
<ul>
<li>Iterator is valid input iterator</li>
</ul>
<p>Postconditions</p>
<ul>
<li>p points to the last consumed character </li>
</ul>

</div>
</div>
<a class="anchor" id="a8ff625b2c19b0d4132f7ec9e6303cb36"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<div class="memtemplate">
template&lt;typename Iterator &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a> <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::decode_valid </td>
          <td>(</td>
          <td class="paramtype">Iterator &amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Decodes valid UTF sequence that is pointed by p into code point.</p>
<p>If the sequence is invalid or points to end the behavior is undefined </p>

</div>
</div>
<a class="anchor" id="acd59f628af084f800f8a86cdd8124fd8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<div class="memtemplate">
template&lt;typename Iterator &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Iterator <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::encode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Iterator&#160;</td>
          <td class="paramname"><em>out</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Convert valid Unicode code point <em>value</em> to the UTF sequence.</p>
<p>Requirements:</p>
<ul>
<li><em>value</em> is valid code point</li>
<li><em>out</em> is an output iterator should be able to accept at least width(value) units</li>
</ul>
<p>Returns the iterator past the last written code unit. </p>

</div>
</div>
<a class="anchor" id="a19789c4c26c8d9f576de5272f3d41a11"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::is_lead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a>&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns true if c is lead code unit, always true of UTF-32 </p>

</div>
</div>
<a class="anchor" id="ae2cb78fcb8a58bed3e0ce1d6528a719a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::is_trail </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a>&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns true if c is trail code unit, always false for UTF-32 </p>

</div>
</div>
<a class="anchor" id="a8a6b72ba87a817652f522018df51a9a7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::trail_length </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html#accca9dc2d8fe018b9b5640c48e3470e4">char_type</a>&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the size of the trail part of variable length encoded sequence.</p>
<p>Returns -1 if C is not valid lead character </p>

</div>
</div>
<a class="anchor" id="a26c106ec8816f48431f882017ab46763"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::width </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceboost_1_1locale_1_1utf.html#a068111a6b9d6d465a63893ed5c05e2f8">code_point</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The width of specific code point in the code units.</p>
<p>Requirement: value is a valid Unicode code point Returns value in range [1..max_width] </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="abb4cb63a924d19505c2cb6e930c68a13"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharType, int size = sizeof(CharType)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int <a class="el" href="structboost_1_1locale_1_1utf_1_1utf__traits.html">boost::locale::utf::utf_traits</a>&lt; CharType, size &gt;::max_width</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Maximal width of valid sequence in the code units:</p>
<ul>
<li>UTF-8 - 4</li>
<li>UTF-16 - 2</li>
<li>UTF-32 - 1 </li>
</ul>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>boost/locale/<a class="el" href="utf_8hpp_source.html">utf.hpp</a></li>
</ul>
</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>
