blob: bf8fefb1b9e65e9c7c229cc1a8dc6343848f825a [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/boundary/types.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('types_8hpp.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">boost/locale/boundary/types.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_TYPES_HPP_INCLUDED</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define BOOST_LOCALE_BOUNDARY_TYPES_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/cstdint.hpp&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;boost/assert.hpp&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#ifdef BOOST_MSVC</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor"># pragma warning(push)</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor"># pragma warning(disable : 4275 4251 4231 4660)</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="keyword">namespace </span>boost {
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="keyword">namespace </span>locale {
<a name="l00023"></a>00023
<a name="l00027"></a>00027 <span class="keyword">namespace </span>boundary {
<a name="l00035"></a>00035
<a name="l00039"></a><a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">00039</a> <span class="keyword">enum</span> <a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> {
<a name="l00040"></a><a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641ae80c964112541d88af9b875dafb6605d">00040</a> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641ae80c964112541d88af9b875dafb6605d" title="Analyse the text for character boundaries.">character</a>,
<a name="l00041"></a><a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a99aad8b8a5e25baa9f695abe5e574bb6">00041</a> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a99aad8b8a5e25baa9f695abe5e574bb6" title="Analyse the text for word boundaries.">word</a>,
<a name="l00042"></a><a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a88aa1509eace7589f5df87d4694871e9">00042</a> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a88aa1509eace7589f5df87d4694871e9" title="Analyse the text for Find sentence boundaries.">sentence</a>,
<a name="l00043"></a><a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a72895419fdd7219b3695cf0abd602ea4">00043</a> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a72895419fdd7219b3695cf0abd602ea4" title="Analyse the text for positions suitable for line breaks.">line</a>
<a name="l00044"></a>00044 };
<a name="l00045"></a>00045
<a name="l00051"></a><a class="code" href="group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">00051</a> <span class="keyword">typedef</span> uint32_t <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 name="l00052"></a>00052
<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">const</span> <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 name="l00058"></a><a class="code" href="group__boundary.html#ga90cf4f01b95658f659685377226677e7">00058</a> <a class="code" href="group__boundary.html#ga90cf4f01b95658f659685377226677e7" title="Not a word, like white space or punctuation mark.">word_none</a> = 0x0000F,
<a name="l00059"></a><a class="code" href="group__boundary.html#gaac78a3a6b9e671e253a2591cb56a479b">00059</a> <a class="code" href="group__boundary.html#gaac78a3a6b9e671e253a2591cb56a479b" title="Word that appear to be a number.">word_number</a> = 0x000F0,
<a name="l00060"></a><a class="code" href="group__boundary.html#ga8b7e6ce2fcb185845fa85a1a4c42b3c4">00060</a> <a class="code" href="group__boundary.html#ga8b7e6ce2fcb185845fa85a1a4c42b3c4" title="Word that contains letters, excluding kana and ideographic characters.">word_letter</a> = 0x00F00,
<a name="l00061"></a><a class="code" href="group__boundary.html#ga52d8c63e1f3f8c898c645352206a78ef">00061</a> <a class="code" href="group__boundary.html#ga52d8c63e1f3f8c898c645352206a78ef" title="Word that contains kana characters.">word_kana</a> = 0x0F000,
<a name="l00062"></a><a class="code" href="group__boundary.html#ga705ab96f9e62810c8ed977c90d404ef8">00062</a> <a class="code" href="group__boundary.html#ga705ab96f9e62810c8ed977c90d404ef8" title="Word that contains ideographic characters.">word_ideo</a> = 0xF0000,
<a name="l00063"></a><a class="code" href="group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">00063</a> <a class="code" href="group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc" title="Any word including numbers, 0 is special flag, equivalent to 15.">word_any</a> = 0xFFFF0,
<a name="l00064"></a><a class="code" href="group__boundary.html#gae412d31a918dc793500fed7278663047">00064</a> <a class="code" href="group__boundary.html#gae412d31a918dc793500fed7278663047" title="Any word, excluding numbers but including letters, kana and ideograms.">word_letters</a> = 0xFFF00,
<a name="l00065"></a><a class="code" href="group__boundary.html#ga5de65589628267ab7f2a51f4147d43f9">00065</a> <a class="code" href="group__boundary.html#ga5de65589628267ab7f2a51f4147d43f9" title="Word that includes kana or ideographic characters.">word_kana_ideo</a> = 0xFF000,
<a name="l00066"></a><a class="code" href="group__boundary.html#gad11031065617b6be9d4662d2c06afd52">00066</a> <a class="code" href="group__boundary.html#gad11031065617b6be9d4662d2c06afd52">word_mask</a> = 0xFFFFF;
<a name="l00067"></a>00067
<a name="l00068"></a>00068
<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keyword">const</span> <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 name="l00074"></a><a class="code" href="group__boundary.html#gaa6a7b6ea3c63a1101a945b82eb10ebd0">00074</a> <a class="code" href="group__boundary.html#gaa6a7b6ea3c63a1101a945b82eb10ebd0" title="Soft line break: optional but not required.">line_soft</a> = 0x0F,
<a name="l00075"></a><a class="code" href="group__boundary.html#ga04faac8129ca14e4e5a789652ee8ecab">00075</a> <a class="code" href="group__boundary.html#ga04faac8129ca14e4e5a789652ee8ecab" title="Hard line break: like break is required (as per CR/LF)">line_hard</a> = 0xF0,
<a name="l00076"></a><a class="code" href="group__boundary.html#ga33fb765abbab27ee07cf70bfab8f47e0">00076</a> <a class="code" href="group__boundary.html#ga33fb765abbab27ee07cf70bfab8f47e0" title="Soft or Hard line break.">line_any</a> = 0xFF,
<a name="l00077"></a><a class="code" href="group__boundary.html#gad5d8f2ac695f14b58d5df277aa5939f9">00077</a> <a class="code" href="group__boundary.html#gad5d8f2ac695f14b58d5df277aa5939f9" title="Select all types of line breaks.">line_mask</a> = 0xFF;
<a name="l00078"></a>00078
<a name="l00080"></a>00080
<a name="l00086"></a>00086 <span class="keyword">static</span> <span class="keyword">const</span> <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 name="l00087"></a><a class="code" href="group__boundary.html#ga3befefe67f79691c117bf5588741355b">00087</a> <a class="code" href="group__boundary.html#ga3befefe67f79691c117bf5588741355b" title="The sentence was terminated with a sentence terminator like &quot;.&quot;, &quot;!&quot; possible followed by hard separa...">sentence_term</a> = 0x0F,
<a name="l00088"></a>00088
<a name="l00089"></a><a class="code" href="group__boundary.html#gaf67883341dd3d8f786e7281d40790000">00089</a> <a class="code" href="group__boundary.html#gaf67883341dd3d8f786e7281d40790000" title="The sentence does not contain terminator like &quot;.&quot;, &quot;!&quot; but ended with hard separator like CR...">sentence_sep</a> = 0xF0,
<a name="l00090"></a>00090
<a name="l00091"></a><a class="code" href="group__boundary.html#gae2042518b20123ec14fbf71458ec9c79">00091</a> <a class="code" href="group__boundary.html#gae2042518b20123ec14fbf71458ec9c79" title="Either first or second sentence break type;.">sentence_any</a> = 0xFF,
<a name="l00092"></a><a class="code" href="group__boundary.html#gacd2a521edb550e75c624000a1089934c">00092</a> <a class="code" href="group__boundary.html#gacd2a521edb550e75c624000a1089934c" title="Select all sentence breaking points.">sentence_mask</a> = 0xFF;
<a name="l00093"></a>00093
<a name="l00095"></a>00095
<a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keyword">const</span> <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 name="l00103"></a><a class="code" href="group__boundary.html#ga9f9e97f7d234139cabe4c4df92a6d4b5">00103</a> <a class="code" href="group__boundary.html#ga9f9e97f7d234139cabe4c4df92a6d4b5" title="Not in use, just for consistency.">character_any</a> = 0xF,
<a name="l00104"></a><a class="code" href="group__boundary.html#gad151135cfe341d3c1f63bf459f6a1f4c">00104</a> <a class="code" href="group__boundary.html#gad151135cfe341d3c1f63bf459f6a1f4c" title="Select all character breaking points.">character_mask</a> = 0xF;
<a name="l00105"></a>00105
<a name="l00107"></a>00107
<a name="l00111"></a><a class="code" href="group__boundary.html#ga99daacb708289fe81def9f1ce4486515">00111</a> <span class="keyword">inline</span> <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="group__boundary.html#ga99daacb708289fe81def9f1ce4486515">boundary_rule</a>(<a class="code" href="group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type</a> t)
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <span class="keywordflow">switch</span>(t) {
<a name="l00114"></a>00114 <span class="keywordflow">case</span> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641ae80c964112541d88af9b875dafb6605d" title="Analyse the text for character boundaries.">character</a>: <span class="keywordflow">return</span> <a class="code" href="group__boundary.html#gad151135cfe341d3c1f63bf459f6a1f4c" title="Select all character breaking points.">character_mask</a>;
<a name="l00115"></a>00115 <span class="keywordflow">case</span> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a99aad8b8a5e25baa9f695abe5e574bb6" title="Analyse the text for word boundaries.">word</a>: <span class="keywordflow">return</span> <a class="code" href="group__boundary.html#gad11031065617b6be9d4662d2c06afd52">word_mask</a>;
<a name="l00116"></a>00116 <span class="keywordflow">case</span> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a88aa1509eace7589f5df87d4694871e9" title="Analyse the text for Find sentence boundaries.">sentence</a>: <span class="keywordflow">return</span> <a class="code" href="group__boundary.html#gacd2a521edb550e75c624000a1089934c" title="Select all sentence breaking points.">sentence_mask</a>;
<a name="l00117"></a>00117 <span class="keywordflow">case</span> <a class="code" href="group__boundary.html#gga15de9963ce9bb6037c8525901dfbf641a72895419fdd7219b3695cf0abd602ea4" title="Analyse the text for positions suitable for line breaks.">line</a>: <span class="keywordflow">return</span> <a class="code" href="group__boundary.html#gad5d8f2ac695f14b58d5df277aa5939f9" title="Select all types of line breaks.">line_mask</a>;
<a name="l00118"></a>00118 <span class="keywordflow">default</span>: <span class="keywordflow">return</span> 0;
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00125"></a>00125
<a name="l00126"></a>00126 } <span class="comment">// boundary</span>
<a name="l00127"></a>00127 } <span class="comment">// locale</span>
<a name="l00128"></a>00128 } <span class="comment">// boost</span>
<a name="l00129"></a>00129
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="preprocessor">#ifdef BOOST_MSVC</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(pop)</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>
<a name="l00135"></a>00135 <span class="preprocessor">#endif</span>
<a name="l00136"></a>00136 <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>types.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>