<!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::boundary::segment_index&lt; BaseIterator &gt; Class 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('classboost_1_1locale_1_1boundary_1_1segment__index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classboost_1_1locale_1_1boundary_1_1segment__index-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">boost::locale::boundary::segment_index&lt; BaseIterator &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__boundary.html">Boundary Analysis</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>This class holds an index of segments in the text range and allows to iterate over them.  
 <a href="classboost_1_1locale_1_1boundary_1_1segment__index.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="index_8hpp_source.html">boost/locale/boundary/index.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:ga06f2faacb9d196ebc659ad5382ea2ca5"><td class="memItemLeft" align="right" valign="top">typedef BaseIterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a></td></tr>
<tr class="separator:ga06f2faacb9d196ebc659ad5382ea2ca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7a775e77dbbca3495e11d646df96fd2"><td class="memItemLeft" align="right" valign="top">typedef unspecified_iterator_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator</a></td></tr>
<tr class="separator:gaf7a775e77dbbca3495e11d646df96fd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5f8e61b5babc3f0fa95f5fb8acae3724"><td class="memItemLeft" align="right" valign="top">typedef unspecified_iterator_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga5f8e61b5babc3f0fa95f5fb8acae3724">const_iterator</a></td></tr>
<tr class="separator:ga5f8e61b5babc3f0fa95f5fb8acae3724"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga067c663d18faee08adb3355701ae72ba"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classboost_1_1locale_1_1boundary_1_1segment.html">segment</a>&lt; <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga067c663d18faee08adb3355701ae72ba">value_type</a></td></tr>
<tr class="separator:ga067c663d18faee08adb3355701ae72ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ga2c354f4cc03677b58c97038cd84dc465"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga2c354f4cc03677b58c97038cd84dc465">segment_index</a> ()</td></tr>
<tr class="separator:ga2c354f4cc03677b58c97038cd84dc465"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06ddc335e95479ec51e9b16d0f829bb3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga06ddc335e95479ec51e9b16d0f829bb3">segment_index</a> (<a class="el" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> type, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin</a>, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end</a>, <a class="el" href="group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type</a> mask, std::locale const &amp;loc=std::locale())</td></tr>
<tr class="separator:ga06ddc335e95479ec51e9b16d0f829bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga46a5f584d5a1a43ad4bc0fff07183fcc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga46a5f584d5a1a43ad4bc0fff07183fcc">segment_index</a> (<a class="el" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> type, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin</a>, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end</a>, std::locale const &amp;loc=std::locale())</td></tr>
<tr class="separator:ga46a5f584d5a1a43ad4bc0fff07183fcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8187f58177fc89ef2f8f818a37111363"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga8187f58177fc89ef2f8f818a37111363">segment_index</a> (<a class="el" href="classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index</a>&lt; <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> &gt; const &amp;)</td></tr>
<tr class="separator:ga8187f58177fc89ef2f8f818a37111363"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae7941dc874ca05d2ef2a03f781c5b78a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1locale_1_1boundary_1_1segment__index.html">segment_index</a> const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gae7941dc874ca05d2ef2a03f781c5b78a">operator=</a> (<a class="el" href="classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index</a>&lt; <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> &gt; const &amp;)</td></tr>
<tr class="separator:gae7941dc874ca05d2ef2a03f781c5b78a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafa2a756b10d3522743204b45b794bb3e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gafa2a756b10d3522743204b45b794bb3e">map</a> (<a class="el" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> type, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin</a>, <a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> <a class="el" href="group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end</a>, std::locale const &amp;loc=std::locale())</td></tr>
<tr class="separator:gafa2a756b10d3522743204b45b794bb3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf74ff9c86c177efa8f74856277d659af"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin</a> () const </td></tr>
<tr class="separator:gaf74ff9c86c177efa8f74856277d659af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8757062d2446b35675b585651c5fea9f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end</a> () const </td></tr>
<tr class="separator:ga8757062d2446b35675b585651c5fea9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2480236106971797460187777f2a4411"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga2480236106971797460187777f2a4411">find</a> (<a class="el" href="group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator</a> p) const </td></tr>
<tr class="separator:ga2480236106971797460187777f2a4411"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72b4ceb5bacec0eded2601c43a4d671a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule</a> () const </td></tr>
<tr class="separator:ga72b4ceb5bacec0eded2601c43a4d671a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad19735180401edb15acbdbbeb21e5a73"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gad19735180401edb15acbdbbeb21e5a73">rule</a> (<a class="el" href="group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type</a> v)</td></tr>
<tr class="separator:gad19735180401edb15acbdbbeb21e5a73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gace7faa10d536c85df0f2d5cac85f2bbc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select</a> () const </td></tr>
<tr class="separator:gace7faa10d536c85df0f2d5cac85f2bbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga205fd51daa439a18527675e663a0802f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__boundary.html#ga205fd51daa439a18527675e663a0802f">full_select</a> (bool v)</td></tr>
<tr class="separator:ga205fd51daa439a18527675e663a0802f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ga960209e8a9453221641eda6bd8c4989b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga960209e8a9453221641eda6bd8c4989b"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>boundary_point_index&lt; base_iterator &gt;</b></td></tr>
<tr class="separator:ga960209e8a9453221641eda6bd8c4989b"><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 BaseIterator&gt;<br/>
class boost::locale::boundary::segment_index&lt; BaseIterator &gt;</h3>

<p>This class holds an index of segments in the text range and allows to iterate over them. </p>
<p>This class is provides <a class="el" href="group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin()</a> and <a class="el" href="group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end()</a> member functions that return bidirectional iterators to the <a class="el" href="classboost_1_1locale_1_1boundary_1_1segment.html">segment</a> objects.</p>
<p>It provides two options on way of selecting segments:</p>
<ul>
<li><a class="el" href="group__boundary.html#gad19735180401edb15acbdbbeb21e5a73">rule(rule_type mask)</a> - a mask that allows to select only specific types of segments according to various masks as <a class="el" href="group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any</a>. <br/>
 The default is to select any types of boundaries. <br/>
 For example: using word boundary analysis, when the provided mask is <a class="el" href="group__boundary.html#ga52d8c63e1f3f8c898c645352206a78ef">word_kana</a> then the iterators would iterate only over the words containing Kana letters and <a class="el" href="group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any</a> would select all types of words excluding ranges that consist of white space and punctuation marks. So iterating over the text "to be or not to be?" with <a class="el" href="group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any</a> rule would return segments "to", "be", "or", "not", "to", "be", instead of default "to", " ", "be", " ", "or", " ", "not", " ", "to", " ", "be", "?".</li>
<li><a class="el" href="group__boundary.html#ga205fd51daa439a18527675e663a0802f">full_select(bool how)</a> - a flag that defines the way a range is selected if the rule of the previous boundary point does not fit the selected rule. <br/>
 For example: We want to fetch all sentences from the following text: "Hello! How\nare you?". <br/>
 This text contains three boundary points separating it to sentences by different rules:<ul>
<li>The exclamation mark "!" ends the sentence "Hello!"</li>
<li>The line feed that splits the sentence "How\nare you?" into two parts.</li>
<li>The question mark that ends the second sentence. <br/>
 If you would only change the <a class="el" href="group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule()</a> to <a class="el" href="group__boundary.html#ga3befefe67f79691c117bf5588741355b">sentence_term</a> then the <a class="el" href="classboost_1_1locale_1_1boundary_1_1segment__index.html" title="This class holds an index of segments in the text range and allows to iterate over them...">segment_index</a> would provide two sentences "Hello!" and "are you?" as only them actually terminated with required terminator "!" or "?". But changing <a class="el" href="group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select()</a> to true, the selected segment would include all the text up to previous valid boundary point and would return two expected sentences: "Hello!" and "How\nare you?".</li>
</ul>
</li>
</ul>
<p>This class allows to find a segment according to the given iterator in range using <a class="el" href="group__boundary.html#ga2480236106971797460187777f2a4411">find()</a> member function.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<ul>
<li>Changing any of the options - <a class="el" href="group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule()</a> or <a class="el" href="group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select()</a> and of course re-indexing the text invalidates existing iterators and they can't be used any more.</li>
<li><a class="el" href="classboost_1_1locale_1_1boundary_1_1segment__index.html" title="This class holds an index of segments in the text range and allows to iterate over them...">segment_index</a> can be created from <a class="el" href="classboost_1_1locale_1_1boundary_1_1boundary__point__index.html" title="This class holds an index of boundary points and allows iterating over them. ">boundary_point_index</a> or other <a class="el" href="classboost_1_1locale_1_1boundary_1_1segment__index.html" title="This class holds an index of segments in the text range and allows to iterate over them...">segment_index</a> that was created with same <a class="el" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a>. This is very fast operation as they shared same index and it does not require its regeneration.</li>
</ul>
<dl class="section see"><dt>See Also</dt><dd></dd></dl>
<ul>
<li><a class="el" href="classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index</a></li>
<li><a class="el" href="classboost_1_1locale_1_1boundary_1_1segment.html">segment</a></li>
<li><a class="el" href="classboost_1_1locale_1_1boundary_1_1boundary__point.html">boundary_point</a> </li>
</ul>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="boundary_8cpp-example.html#_a1">boundary.cpp</a>, and <a class="el" href="wboundary_8cpp-example.html#_a1">wboundary.cpp</a>.</dd>
</dl></div><hr/>The documentation for this class was generated from the following file:<ul>
<li>boost/locale/boundary/<a class="el" href="index_8hpp_source.html">index.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>
