UNPKG

boost-react-native-bundle

Version:

Boost library as in https://sourceforge.net/projects/boost/files/boost/1.57.0/

249 lines (231 loc) 21.1 kB
<!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/boundary/facets.hpp Source File</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><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><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="files.html"><span>File&#160;List</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('facets_8hpp.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <div class="title">boost/locale/boundary/facets.hpp</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> <a name="l00002"></a>00002 <span class="comment">// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)</span> <a name="l00003"></a>00003 <span class="comment">//</span> <a name="l00004"></a>00004 <span class="comment">// Distributed under the Boost Software License, Version 1.0. (See</span> <a name="l00005"></a>00005 <span class="comment">// accompanying file LICENSE_1_0.txt or copy at</span> <a name="l00006"></a>00006 <span class="comment">// http://www.boost.org/LICENSE_1_0.txt)</span> <a name="l00007"></a>00007 <span class="comment">//</span> <a name="l00008"></a>00008 <span class="preprocessor">#ifndef BOOST_LOCALE_BOUNDARY_FACETS_HPP_INCLUDED</span> <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define BOOST_LOCALE_BOUNDARY_FACETS_HPP_INCLUDED</span> <a name="l00010"></a>00010 <span class="preprocessor"></span> <a name="l00011"></a>00011 <span class="preprocessor">#include &lt;boost/locale/config.hpp&gt;</span> <a name="l00012"></a>00012 <span class="preprocessor">#include &lt;boost/locale/boundary/types.hpp&gt;</span> <a name="l00013"></a>00013 <span class="preprocessor">#ifdef BOOST_MSVC</span> <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor"># pragma warning(push)</span> <a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor"># pragma warning(disable : 4275 4251 4231 4660)</span> <a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#include &lt;locale&gt;</span> <a name="l00018"></a>00018 <span class="preprocessor">#include &lt;vector&gt;</span> <a name="l00019"></a>00019 <a name="l00020"></a>00020 <a name="l00021"></a>00021 <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="keyword">namespace </span>boost { <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keyword">namespace </span>locale { <a name="l00026"></a>00026 <a name="l00030"></a>00030 <span class="keyword">namespace </span>boundary { <a name="l00036"></a>00036 <a name="l00037"></a>00037 <a name="l00042"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html">00042</a> <span class="keyword">struct </span><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html" title="This structure is used for representing boundary point that follows the offset.">break_info</a> { <a name="l00043"></a>00043 <a name="l00047"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a2ad400451f8cf8ca04924a26cb694043">00047</a> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a2ad400451f8cf8ca04924a26cb694043">break_info</a>() : <a name="l00048"></a>00048 <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">offset</a>(0), <a name="l00049"></a>00049 <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a1a9b497daacb471f297682101696f4eb">rule</a>(0) <a name="l00050"></a>00050 { <a name="l00051"></a>00051 } <a name="l00056"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#ab2012ba50dc8730bf7e2b448fff8be33">00056</a> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a2ad400451f8cf8ca04924a26cb694043">break_info</a>(<span class="keywordtype">size_t</span> v) : <a name="l00057"></a>00057 <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">offset</a>(v), <a name="l00058"></a>00058 <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a1a9b497daacb471f297682101696f4eb">rule</a>(0) <a name="l00059"></a>00059 { <a name="l00060"></a>00060 } <a name="l00061"></a>00061 <a name="l00065"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">00065</a> <span class="keywordtype">size_t</span> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">offset</a>; <a name="l00070"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a1a9b497daacb471f297682101696f4eb">00070</a> <a class="code" href="group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095" title="Flags used with word boundary analysis -- the type of the word, line or sentence boundary found...">rule_type</a> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a1a9b497daacb471f297682101696f4eb">rule</a>; <a name="l00071"></a>00071 <a name="l00076"></a><a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a6ef38e6f115ed9121e4d8f6189f6c4e2">00076</a> <span class="keywordtype">bool</span> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a6ef38e6f115ed9121e4d8f6189f6c4e2">operator&lt;</a>(<a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html" title="This structure is used for representing boundary point that follows the offset.">break_info</a> <span class="keyword">const</span> &amp;other)<span class="keyword"> const</span> <a name="l00077"></a>00077 <span class="keyword"> </span>{ <a name="l00078"></a>00078 <span class="keywordflow">return</span> <a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">offset</a> &lt; other.<a class="code" href="structboost_1_1locale_1_1boundary_1_1break__info.html#a47cdf1764bf8e294ea8a1079501a8c44">offset</a>; <a name="l00079"></a>00079 } <a name="l00080"></a>00080 }; <a name="l00081"></a>00081 <a name="l00086"></a><a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">00086</a> <span class="keyword">typedef</span> std::vector&lt;break_info&gt; <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a>; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> CharType&gt; <a name="l00090"></a>00090 <span class="keyword">class </span><a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html" title="This facet generates an index for boundary analysis for a given text.">boundary_indexing</a>; <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="preprocessor"> #ifdef BOOST_LOCALE_DOXYGEN</span> <a name="l00093"></a>00093 <span class="preprocessor"></span> <a name="l00094"></a>00094 <a name="l00095"></a>00095 <a name="l00096"></a>00096 <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a name="l00099"></a>00099 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Char&gt; <a name="l00100"></a><a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html">00100</a> <span class="keyword">class </span>BOOST_LOCALE_DECL <a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html" title="This facet generates an index for boundary analysis for a given text.">boundary_indexing</a> : <span class="keyword">public</span> std::locale::facet { <a name="l00101"></a>00101 <span class="keyword">public</span>: <a name="l00105"></a><a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html#a251d097b8498d6dade6110b0829c8cf5">00105</a> <a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html" title="This facet generates an index for boundary analysis for a given text.">boundary_indexing</a>(<span class="keywordtype">size_t</span> refs=0) : std::locale::facet(refs) <a name="l00106"></a>00106 { <a name="l00107"></a>00107 } <a name="l00115"></a>00115 <span class="keyword">virtual</span> <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a> map(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t,Char <span class="keyword">const</span> *begin,Char <span class="keyword">const</span> *end) <span class="keyword">const</span> = 0; <a name="l00119"></a><a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html#a6ec435e58e34f70046f62ac0314c1a58">00119</a> <span class="keyword">static</span> std::locale::id <a class="code" href="classboost_1_1locale_1_1boundary_1_1boundary__indexing.html#a6ec435e58e34f70046f62ac0314c1a58">id</a>; <a name="l00120"></a>00120 <a name="l00121"></a>00121 <span class="preprocessor"> #if defined (__SUNPRO_CC) &amp;&amp; defined (_RWSTD_VER)</span> <a name="l00122"></a>00122 <span class="preprocessor"></span> std::locale::id&amp; __get_id (<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id; } <a name="l00123"></a>00123 <span class="preprocessor"> #endif</span> <a name="l00124"></a>00124 <span class="preprocessor"></span> }; <a name="l00125"></a>00125 <a name="l00126"></a>00126 <span class="preprocessor"> #else</span> <a name="l00127"></a>00127 <span class="preprocessor"></span> <a name="l00128"></a>00128 <span class="keyword">template</span>&lt;&gt; <a name="l00129"></a>00129 <span class="keyword">class </span>BOOST_LOCALE_DECL boundary_indexing&lt;char&gt; : <span class="keyword">public</span> std::locale::facet { <a name="l00130"></a>00130 <span class="keyword">public</span>: <a name="l00131"></a>00131 boundary_indexing(<span class="keywordtype">size_t</span> refs=0) : std::locale::facet(refs) <a name="l00132"></a>00132 { <a name="l00133"></a>00133 } <a name="l00134"></a>00134 <span class="keyword">virtual</span> <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a> map(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t,<span class="keywordtype">char</span> <span class="keyword">const</span> *begin,<span class="keywordtype">char</span> <span class="keyword">const</span> *end) <span class="keyword">const</span> = 0; <a name="l00135"></a>00135 <span class="keyword">static</span> std::locale::id id; <a name="l00136"></a>00136 <span class="preprocessor"> #if defined (__SUNPRO_CC) &amp;&amp; defined (_RWSTD_VER)</span> <a name="l00137"></a>00137 <span class="preprocessor"></span> std::locale::id&amp; __get_id (<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id; } <a name="l00138"></a>00138 <span class="preprocessor"> #endif</span> <a name="l00139"></a>00139 <span class="preprocessor"></span> }; <a name="l00140"></a>00140 <a name="l00141"></a>00141 <span class="keyword">template</span>&lt;&gt; <a name="l00142"></a>00142 <span class="keyword">class </span>BOOST_LOCALE_DECL boundary_indexing&lt;wchar_t&gt; : <span class="keyword">public</span> std::locale::facet { <a name="l00143"></a>00143 <span class="keyword">public</span>: <a name="l00144"></a>00144 boundary_indexing(<span class="keywordtype">size_t</span> refs=0) : std::locale::facet(refs) <a name="l00145"></a>00145 { <a name="l00146"></a>00146 } <a name="l00147"></a>00147 <span class="keyword">virtual</span> <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a> map(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t,<span class="keywordtype">wchar_t</span> <span class="keyword">const</span> *begin,<span class="keywordtype">wchar_t</span> <span class="keyword">const</span> *end) <span class="keyword">const</span> = 0; <a name="l00148"></a>00148 <a name="l00149"></a>00149 <span class="keyword">static</span> std::locale::id id; <a name="l00150"></a>00150 <span class="preprocessor"> #if defined (__SUNPRO_CC) &amp;&amp; defined (_RWSTD_VER)</span> <a name="l00151"></a>00151 <span class="preprocessor"></span> std::locale::id&amp; __get_id (<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id; } <a name="l00152"></a>00152 <span class="preprocessor"> #endif</span> <a name="l00153"></a>00153 <span class="preprocessor"></span> }; <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="preprocessor"> #ifdef BOOST_HAS_CHAR16_T</span> <a name="l00156"></a>00156 <span class="preprocessor"></span> <span class="keyword">template</span>&lt;&gt; <a name="l00157"></a>00157 <span class="keyword">class </span>BOOST_LOCALE_DECL boundary_indexing&lt;char16_t&gt; : <span class="keyword">public</span> std::locale::facet { <a name="l00158"></a>00158 <span class="keyword">public</span>: <a name="l00159"></a>00159 boundary_indexing(<span class="keywordtype">size_t</span> refs=0) : std::locale::facet(refs) <a name="l00160"></a>00160 { <a name="l00161"></a>00161 } <a name="l00162"></a>00162 <span class="keyword">virtual</span> <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a> map(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t,char16_t <span class="keyword">const</span> *begin,char16_t <span class="keyword">const</span> *end) <span class="keyword">const</span> = 0; <a name="l00163"></a>00163 <span class="keyword">static</span> std::locale::id id; <a name="l00164"></a>00164 <span class="preprocessor"> #if defined (__SUNPRO_CC) &amp;&amp; defined (_RWSTD_VER)</span> <a name="l00165"></a>00165 <span class="preprocessor"></span> std::locale::id&amp; __get_id (<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id; } <a name="l00166"></a>00166 <span class="preprocessor"> #endif</span> <a name="l00167"></a>00167 <span class="preprocessor"></span> }; <a name="l00168"></a>00168 <span class="preprocessor"> #endif</span> <a name="l00169"></a>00169 <span class="preprocessor"></span> <a name="l00170"></a>00170 <span class="preprocessor"> #ifdef BOOST_HAS_CHAR32_T</span> <a name="l00171"></a>00171 <span class="preprocessor"></span> <span class="keyword">template</span>&lt;&gt; <a name="l00172"></a>00172 <span class="keyword">class </span>BOOST_LOCALE_DECL boundary_indexing&lt;char32_t&gt; : <span class="keyword">public</span> std::locale::facet { <a name="l00173"></a>00173 <span class="keyword">public</span>: <a name="l00174"></a>00174 boundary_indexing(<span class="keywordtype">size_t</span> refs=0) : std::locale::facet(refs) <a name="l00175"></a>00175 { <a name="l00176"></a>00176 } <a name="l00177"></a>00177 <span class="keyword">virtual</span> <a class="code" href="group__boundary.html#ga7b4dd7af8fad53fabd77e629da24d466">index_type</a> map(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t,char32_t <span class="keyword">const</span> *begin,char32_t <span class="keyword">const</span> *end) <span class="keyword">const</span> = 0; <a name="l00178"></a>00178 <span class="keyword">static</span> std::locale::id id; <a name="l00179"></a>00179 <span class="preprocessor"> #if defined (__SUNPRO_CC) &amp;&amp; defined (_RWSTD_VER)</span> <a name="l00180"></a>00180 <span class="preprocessor"></span> std::locale::id&amp; __get_id (<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id; } <a name="l00181"></a>00181 <span class="preprocessor"> #endif</span> <a name="l00182"></a>00182 <span class="preprocessor"></span> }; <a name="l00183"></a>00183 <span class="preprocessor"> #endif</span> <a name="l00184"></a>00184 <span class="preprocessor"></span> <a name="l00185"></a>00185 <span class="preprocessor"> #endif</span> <a name="l00186"></a>00186 <span class="preprocessor"></span> <a name="l00190"></a>00190 <a name="l00191"></a>00191 <a name="l00192"></a>00192 } <span class="comment">// boundary</span> <a name="l00193"></a>00193 <a name="l00194"></a>00194 } <span class="comment">// locale</span> <a name="l00195"></a>00195 } <span class="comment">// boost</span> <a name="l00196"></a>00196 <a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="preprocessor">#ifdef BOOST_MSVC</span> <a name="l00199"></a>00199 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(pop)</span> <a name="l00200"></a>00200 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00201"></a>00201 <span class="preprocessor"></span> <a name="l00202"></a>00202 <span class="preprocessor">#endif</span> <a name="l00203"></a>00203 <span class="preprocessor"></span><span class="comment">// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4</span> </pre></div></div><!-- contents --> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>facets.hpp</b> </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>