<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!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"/> <title>ICU 4.4.1: plurrule.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>plurrule.h</h1><a href="plurrule_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment">*******************************************************************************</span> <a name="l00003"></a>00003 <span class="comment">* Copyright (C) 2008-2009, International Business Machines Corporation and</span> <a name="l00004"></a>00004 <span class="comment">* others. All Rights Reserved.</span> <a name="l00005"></a>00005 <span class="comment">*******************************************************************************</span> <a name="l00006"></a>00006 <span class="comment">*</span> <a name="l00007"></a>00007 <span class="comment">*</span> <a name="l00008"></a>00008 <span class="comment">* File PLURRULE.H</span> <a name="l00009"></a>00009 <span class="comment">*</span> <a name="l00010"></a>00010 <span class="comment">* Modification History:*</span> <a name="l00011"></a>00011 <span class="comment">* Date Name Description</span> <a name="l00012"></a>00012 <span class="comment">*</span> <a name="l00013"></a>00013 <span class="comment">********************************************************************************</span> <a name="l00014"></a>00014 <span class="comment">*/</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="preprocessor">#ifndef PLURRULE</span> <a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define PLURRULE</span> <a name="l00018"></a>00018 <span class="preprocessor"></span> <a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">unicode/utypes.h</a>"</span> <a name="l00020"></a>00020 <a name="l00026"></a>00026 <span class="preprocessor">#if !UCONFIG_NO_FORMATTING</span> <a name="l00027"></a>00027 <span class="preprocessor"></span> <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="format_8h.html" title="C++ API: Base class for all formats.">unicode/format.h</a>"</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <a class="code" href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b" title="This is used to begin a declaration of a public ICU C++ API.">U_NAMESPACE_BEGIN</a> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="keyword">class </span>Hashtable; <a name="l00033"></a>00033 <span class="keyword">class </span>RuleChain; <a name="l00034"></a>00034 <span class="keyword">class </span>RuleParser; <a name="l00035"></a>00035 <a name="l00104"></a><a class="code" href="classPluralRules.html">00104</a> <span class="keyword">class </span><a class="code" href="utypes_8h.html#ab9d90a30137b6ec046fe59e79b09745a" title="Set to export library symbols from inside the i18n library, and to import them from...">U_I18N_API</a> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a> : <span class="keyword">public</span> <a class="code" href="classUObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class.">UObject</a> { <a name="l00105"></a>00105 <span class="keyword">public</span>: <a name="l00106"></a>00106 <a name="l00114"></a>00114 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status); <a name="l00115"></a>00115 <a name="l00120"></a>00120 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>(<span class="keyword">const</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>& other); <a name="l00121"></a>00121 <a name="l00126"></a>00126 <span class="keyword">virtual</span> ~<a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>(); <a name="l00127"></a>00127 <a name="l00132"></a>00132 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>* clone() <span class="keyword">const</span>; <a name="l00133"></a>00133 <a name="l00138"></a>00138 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>& operator=(<span class="keyword">const</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>&); <a name="l00139"></a>00139 <a name="l00150"></a>00150 <span class="keyword">static</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> createRules(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& description, <a name="l00151"></a>00151 <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status); <a name="l00152"></a>00152 <a name="l00161"></a>00161 <span class="keyword">static</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> createDefaultRules(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status); <a name="l00162"></a>00162 <a name="l00178"></a>00178 <span class="keyword">static</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> forLocale(<span class="keyword">const</span> <a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a>& locale, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status); <a name="l00179"></a>00179 <a name="l00189"></a>00189 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> select(int32_t number) <span class="keyword">const</span>; <a name="l00190"></a>00190 <a name="l00200"></a>00200 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> select(<span class="keywordtype">double</span> number) <span class="keyword">const</span>; <a name="l00201"></a>00201 <a name="l00212"></a>00212 <a class="code" href="classStringEnumeration.html" title="Base class for &#39;pure&#39; C++ implementations of uenum api.">StringEnumeration</a>* getKeywords(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status) <span class="keyword">const</span>; <a name="l00213"></a>00213 <a name="l00223"></a>00223 <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> isKeyword(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& keyword) <span class="keyword">const</span>; <a name="l00224"></a>00224 <a name="l00225"></a>00225 <a name="l00233"></a>00233 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> getKeywordOther() <span class="keyword">const</span>; <a name="l00234"></a>00234 <a name="l00243"></a>00243 <span class="keyword">virtual</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="stringpiece_8h.html#a7652049cbac0bfeae2cd2aa4514a3352" title="Global operator == for StringPiece.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>& other) <span class="keyword">const</span>; <a name="l00244"></a>00244 <a name="l00253"></a><a class="code" href="classPluralRules.html#a0584e7a2285e577782440de32e33e12c">00253</a> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="classPluralRules.html#a0584e7a2285e577782440de32e33e12c" title="Compares the inequality of two PluralRules objects.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>& other)<span class="keyword"> const </span>{<span class="keywordflow">return</span> !<a class="code" href="stringpiece_8h.html#a7652049cbac0bfeae2cd2aa4514a3352" title="Global operator == for StringPiece.">operator==</a>(other);} <a name="l00254"></a>00254 <a name="l00255"></a>00255 <a name="l00262"></a>00262 <span class="keyword">static</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> getStaticClassID(<span class="keywordtype">void</span>); <a name="l00263"></a>00263 <a name="l00269"></a>00269 <span class="keyword">virtual</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262" title="ICU4C &quot;poor man&#39;s RTTI&quot;, returns a UClassID for the actual ICU class...">getDynamicClassID</a>() <span class="keyword">const</span>; <a name="l00270"></a>00270 <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="keyword">private</span>: <a name="l00273"></a>00273 Hashtable *fLocaleStringsHash; <a name="l00274"></a>00274 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> mLocaleName; <a name="l00275"></a>00275 RuleChain *mRules; <a name="l00276"></a>00276 RuleParser *mParser; <a name="l00277"></a>00277 <a name="l00278"></a>00278 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>(); <span class="comment">// default constructor not implemented</span> <a name="l00279"></a>00279 int32_t getRepeatLimit() <span class="keyword">const</span>; <a name="l00280"></a>00280 <span class="keywordtype">void</span> parseDescription(<a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& ruleData, RuleChain& rules, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00281"></a>00281 <span class="keywordtype">void</span> getNextLocale(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& localeData, int32_t* curIndex, <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& localeName); <a name="l00282"></a>00282 <span class="keywordtype">void</span> addRules(RuleChain& rules); <a name="l00283"></a>00283 int32_t getNumberValue(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& token) <span class="keyword">const</span>; <a name="l00284"></a>00284 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> getRuleFromResource(<span class="keyword">const</span> <a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a>& locale, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a>& status); <a name="l00285"></a>00285 <a name="l00286"></a>00286 }; <a name="l00287"></a>00287 <a name="l00288"></a>00288 <a class="code" href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933" title="This is used to end a declaration of a public ICU C++ API.">U_NAMESPACE_END</a> <a name="l00289"></a>00289 <a name="l00290"></a>00290 <span class="preprocessor">#endif </span><span class="comment">/* #if !UCONFIG_NO_FORMATTING */</span> <a name="l00291"></a>00291 <a name="l00292"></a>00292 <span class="preprocessor">#endif // _PLURRULE</span> <a name="l00293"></a>00293 <span class="preprocessor"></span><span class="comment">//eof</span> </pre></div></div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>