<!-- 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: currpinf.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>currpinf.h</h1><a href="currpinf_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) 2009-2010, 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="preprocessor">#ifndef CURRPINF_H</span> <a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define CURRPINF_H</span> <a name="l00009"></a>00009 <span class="preprocessor"></span> <a name="l00010"></a>00010 <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="l00011"></a>00011 <a name="l00017"></a>00017 <span class="preprocessor">#if !UCONFIG_NO_FORMATTING</span> <a name="l00018"></a>00018 <span class="preprocessor"></span> <a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="unistr_8h.html" title="C++ API: Unicode String.">unicode/unistr.h</a>"</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="keyword">union </span>UHashTok; <a name="l00022"></a>00022 <a name="l00023"></a>00023 <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="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keyword">class </span><a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a>; <a name="l00026"></a>00026 <span class="keyword">class </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="l00027"></a>00027 <span class="keyword">class </span>Hashtable; <a name="l00028"></a>00028 <a name="l00046"></a><a class="code" href="classCurrencyPluralInfo.html">00046</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="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</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="l00047"></a>00047 <span class="keyword">public</span>: <a name="l00048"></a>00048 <a name="l00054"></a>00054 <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</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="l00055"></a>00055 <a name="l00062"></a>00062 <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>(<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="l00063"></a>00063 <a name="l00069"></a>00069 <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>(<span class="keyword">const</span> <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& info); <a name="l00070"></a>00070 <a name="l00071"></a>00071 <a name="l00077"></a>00077 <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& operator=(<span class="keyword">const</span> <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& info); <a name="l00078"></a>00078 <a name="l00079"></a>00079 <a name="l00085"></a>00085 <span class="keyword">virtual</span> ~<a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>(); <a name="l00086"></a>00086 <a name="l00087"></a>00087 <a name="l00093"></a>00093 <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="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& info) <span class="keyword">const</span>; <a name="l00094"></a>00094 <a name="l00095"></a>00095 <a name="l00101"></a>00101 <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="stringpiece_8h.html#abf0ccab9536bab551afc07de65eb5d95" title="Global operator != for StringPiece.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& info) <span class="keyword">const</span>; <a name="l00102"></a>00102 <a name="l00103"></a>00103 <a name="l00109"></a>00109 <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>* clone() <span class="keyword">const</span>; <a name="l00110"></a>00110 <a name="l00111"></a>00111 <a name="l00118"></a>00118 <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>* getPluralRules() <span class="keyword">const</span>; <a name="l00119"></a>00119 <a name="l00129"></a>00129 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& getCurrencyPluralPattern(<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>& pluralCount, <a name="l00130"></a>00130 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>& result) <span class="keyword">const</span>; <a name="l00131"></a>00131 <a name="l00138"></a>00138 <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>& getLocale() <span class="keyword">const</span>; <a name="l00139"></a>00139 <a name="l00151"></a>00151 <span class="keywordtype">void</span> setPluralRules(<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>& ruleDescription, <a name="l00152"></a>00152 <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="l00153"></a>00153 <a name="l00167"></a>00167 <span class="keywordtype">void</span> setCurrencyPluralPattern(<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>& pluralCount, <a name="l00168"></a>00168 <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>& pattern, <a name="l00169"></a>00169 <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="l00170"></a>00170 <a name="l00178"></a>00178 <span class="keywordtype">void</span> setLocale(<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>& loc, <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="l00185"></a>00185 <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="l00186"></a>00186 <a name="l00192"></a>00192 <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(); <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="keyword">private</span>: <a name="l00195"></a>00195 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDecimalFormat.html" title="DecimalFormat is a concrete subclass of NumberFormat that formats decimal numbers...">DecimalFormat</a>; <a name="l00196"></a>00196 <a name="l00197"></a>00197 <span class="keywordtype">void</span> initialize(<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>& loc, <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="l00198"></a>00198 <a name="l00199"></a>00199 <span class="keywordtype">void</span> setupCurrencyPluralPattern(<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>& loc, <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="l00200"></a>00200 <a name="l00201"></a>00201 <span class="comment">/*</span> <a name="l00202"></a>00202 <span class="comment"> * delete hash table</span> <a name="l00203"></a>00203 <span class="comment"> *</span> <a name="l00204"></a>00204 <span class="comment"> * @param hTable hash table to be deleted</span> <a name="l00205"></a>00205 <span class="comment"> */</span> <a name="l00206"></a>00206 <span class="keywordtype">void</span> deleteHash(Hashtable* hTable); <a name="l00207"></a>00207 <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="comment">/*</span> <a name="l00210"></a>00210 <span class="comment"> * initialize hash table</span> <a name="l00211"></a>00211 <span class="comment"> *</span> <a name="l00212"></a>00212 <span class="comment"> * @param status output param set to success/failure code on exit</span> <a name="l00213"></a>00213 <span class="comment"> * @return hash table initialized</span> <a name="l00214"></a>00214 <span class="comment"> */</span> <a name="l00215"></a>00215 Hashtable* initHash(<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="l00216"></a>00216 <a name="l00217"></a>00217 <a name="l00218"></a>00218 <a name="l00225"></a>00225 <span class="keywordtype">void</span> copyHash(<span class="keyword">const</span> Hashtable* source, Hashtable* target, <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="l00226"></a>00226 <a name="l00227"></a>00227 <span class="comment">//-------------------- private data member ---------------------</span> <a name="l00228"></a>00228 <span class="comment">// map from plural count to currency plural pattern, for example</span> <a name="l00229"></a>00229 <span class="comment">// a plural pattern defined in "CurrencyUnitPatterns" is</span> <a name="l00230"></a>00230 <span class="comment">// "one{{0} {1}}", in which "one" is a plural count</span> <a name="l00231"></a>00231 <span class="comment">// and "{0} {1}" is a currency plural pattern".</span> <a name="l00232"></a>00232 <span class="comment">// The currency plural pattern saved in this mapping is the pattern</span> <a name="l00233"></a>00233 <span class="comment">// defined in "CurrencyUnitPattern" by replacing</span> <a name="l00234"></a>00234 <span class="comment">// {0} with the number format pattern,</span> <a name="l00235"></a>00235 <span class="comment">// and {1} with 3 currency sign.</span> <a name="l00236"></a>00236 Hashtable* fPluralCountToCurrencyUnitPattern; <a name="l00237"></a>00237 <a name="l00238"></a>00238 <span class="comment">/*</span> <a name="l00239"></a>00239 <span class="comment"> * The plural rule is used to format currency plural name,</span> <a name="l00240"></a>00240 <span class="comment"> * for example: "3.00 US Dollars".</span> <a name="l00241"></a>00241 <span class="comment"> * If there are 3 currency signs in the currency patttern,</span> <a name="l00242"></a>00242 <span class="comment"> * the 3 currency signs will be replaced by currency plural name.</span> <a name="l00243"></a>00243 <span class="comment"> */</span> <a name="l00244"></a>00244 <a class="code" href="classPluralRules.html" title="Defines rules for mapping positive long values onto a small set of keywords.">PluralRules</a>* fPluralRules; <a name="l00245"></a>00245 <a name="l00246"></a>00246 <span class="comment">// locale</span> <a name="l00247"></a>00247 <a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a>* fLocale; <a name="l00248"></a>00248 }; <a name="l00249"></a>00249 <a name="l00250"></a>00250 <a name="l00251"></a>00251 <span class="keyword">inline</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a name="l00252"></a><a class="code" href="classCurrencyPluralInfo.html#a4563d66a4ee0ae288731eff01217f272">00252</a> <a class="code" href="classCurrencyPluralInfo.html#a4563d66a4ee0ae288731eff01217f272" title="Not equal operator.">CurrencyPluralInfo::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classCurrencyPluralInfo.html" title="This class represents the information needed by DecimalFormat to format currency...">CurrencyPluralInfo</a>& info)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !<a class="code" href="classCurrencyPluralInfo.html#a334b5d47f05f15eff723a5b4b936aa44" title="Equal operator.">operator==</a>(info); } <a name="l00253"></a>00253 <a name="l00254"></a>00254 <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="l00255"></a>00255 <a name="l00256"></a>00256 <span class="preprocessor">#endif </span><span class="comment">/* #if !UCONFIG_NO_FORMATTING */</span> <a name="l00257"></a>00257 <a name="l00258"></a>00258 <span class="preprocessor">#endif // _CURRPINFO</span> <a name="l00259"></a>00259 <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>