Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > f51238514e2abe817779ad2fe01b0759 > files > 625

icu-doc-4.4-2.1mdv2010.2.i586.rpm

<!-- 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: selfmt.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.1 -->
<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&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>selfmt.h</h1><a href="selfmt_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"> * COPYRIGHT:</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (c) 1997-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"> * Copyright (C) 2010 , Yahoo! Inc.</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 SELFMT.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"> *</span>
<a name="l00012"></a>00012 <span class="comment"> *   Date        Name        Description</span>
<a name="l00013"></a>00013 <span class="comment"> *   11/11/09    kirtig      Finished first cut of implementation.</span>
<a name="l00014"></a>00014 <span class="comment"> ********************************************************************/</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef SELFMT</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define SELFMT</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">unicode/utypes.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="numfmt_8h.html" title="C++ API: Abstract base class for all number formats.">unicode/numfmt.h</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00027"></a>00027 <span class="preprocessor">#if !UCONFIG_NO_FORMATTING</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <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="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="keyword">class </span>Hashtable;
<a name="l00032"></a>00032 
<a name="l00184"></a><a class="code" href="classSelectFormat.html">00184</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="classSelectFormat.html">SelectFormat</a> : <span class="keyword">public</span> <a class="code" href="classFormat.html" title="Base class for all formats.">Format</a> {
<a name="l00185"></a>00185 <span class="keyword">public</span>:
<a name="l00186"></a>00186 
<a name="l00195"></a>00195     <a class="code" href="classSelectFormat.html">SelectFormat</a>(<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>&amp; pattern, <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>&amp; status);
<a name="l00196"></a>00196 
<a name="l00201"></a>00201     <a class="code" href="classSelectFormat.html">SelectFormat</a>(<span class="keyword">const</span> <a class="code" href="classSelectFormat.html">SelectFormat</a>&amp; other);
<a name="l00202"></a>00202 
<a name="l00207"></a>00207     <span class="keyword">virtual</span> ~<a class="code" href="classSelectFormat.html">SelectFormat</a>();
<a name="l00208"></a>00208 
<a name="l00220"></a>00220     <span class="keywordtype">void</span> applyPattern(<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>&amp; pattern, <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>&amp; status);
<a name="l00221"></a>00221 
<a name="l00222"></a>00222 
<a name="l00223"></a>00223     <span class="keyword">using</span> <a class="code" href="classFormat.html#af3f0b157f07d6e9f908da69c99239600" title="Formats an object to produce a string.">Format::format</a>;
<a name="l00224"></a>00224 
<a name="l00238"></a>00238     <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; <a class="code" href="classFormat.html#af3f0b157f07d6e9f908da69c99239600" title="Formats an object to produce a string.">format</a>(<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>&amp; keyword,
<a name="l00239"></a>00239                             <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; appendTo,
<a name="l00240"></a>00240                             <a class="code" href="classFieldPosition.html" title="FieldPosition is a simple class used by Format and its subclasses to identify fields...">FieldPosition</a>&amp; pos,
<a name="l00241"></a>00241                             <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>&amp; status) <span class="keyword">const</span>;
<a name="l00242"></a>00242 
<a name="l00249"></a>00249     <a class="code" href="classSelectFormat.html">SelectFormat</a>&amp; <a class="code" href="classFormat.html#a7a5276a88c488462eea3a508b71f4d9c">operator=</a>(<span class="keyword">const</span> <a class="code" href="classSelectFormat.html">SelectFormat</a>&amp; other);
<a name="l00250"></a>00250 
<a name="l00258"></a>00258     <span class="keyword">virtual</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="classFormat.html#ad9be7e8b7bef97013ff74ef1be3903a5" title="Return true if the given Format objects are semantically equal.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classFormat.html" title="Base class for all formats.">Format</a>&amp; other) <span class="keyword">const</span>;
<a name="l00259"></a>00259 
<a name="l00267"></a>00267     <span class="keyword">virtual</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="classFormat.html#a4f65d87226814931dde8b035f47b69f3" title="Return true if the given Format objects are not semantically equal.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classFormat.html" title="Base class for all formats.">Format</a>&amp; other) <span class="keyword">const</span>;
<a name="l00268"></a>00268 
<a name="l00274"></a>00274     <span class="keyword">virtual</span> <a class="code" href="classFormat.html" title="Base class for all formats.">Format</a>* <a class="code" href="classFormat.html#a4e7ebd5cfd390c35e2bda88257f8b51a" title="Clone this object polymorphically.">clone</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00275"></a>00275 
<a name="l00291"></a>00291     <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; <a class="code" href="classFormat.html#af3f0b157f07d6e9f908da69c99239600" title="Formats an object to produce a string.">format</a>(<span class="keyword">const</span> <a class="code" href="classFormattable.html" title="Formattable objects can be passed to the Format class or its subclasses for formatting...">Formattable</a>&amp; obj,
<a name="l00292"></a>00292                          <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; appendTo,
<a name="l00293"></a>00293                          <a class="code" href="classFieldPosition.html" title="FieldPosition is a simple class used by Format and its subclasses to identify fields...">FieldPosition</a>&amp; pos,
<a name="l00294"></a>00294                          <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>&amp; status) <span class="keyword">const</span>;
<a name="l00295"></a>00295 
<a name="l00304"></a>00304     <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; toPattern(<a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a>&amp; appendTo);
<a name="l00305"></a>00305 
<a name="l00328"></a>00328     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classFormat.html#aa53bea97b986c2f21e5638aa30aa08b7" title="Parse a string to produce an object.">parseObject</a>(<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>&amp; source,
<a name="l00329"></a>00329                             <a class="code" href="classFormattable.html" title="Formattable objects can be passed to the Format class or its subclasses for formatting...">Formattable</a>&amp; result,
<a name="l00330"></a>00330                             <a class="code" href="classParsePosition.html" title="ParsePosition is a simple class used by Format and its subclasses to keep track of...">ParsePosition</a>&amp; parse_pos) <span class="keyword">const</span>;
<a name="l00331"></a>00331 
<a name="l00336"></a>00336     <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="l00337"></a>00337 
<a name="l00342"></a>00342     <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="classFormat.html#ac961d410d174518e5a3ebb8bbef45cd7" title="Returns a unique class ID POLYMORPHICALLY.">getDynamicClassID</a>() <span class="keyword">const</span>;
<a name="l00343"></a>00343 
<a name="l00344"></a>00344 <span class="keyword">private</span>:
<a name="l00345"></a>00345     <span class="keyword">typedef</span> <span class="keyword">enum class</span>esForSelectFormat{
<a name="l00346"></a>00346         tStartKeyword,
<a name="l00347"></a>00347         tContinueKeyword,
<a name="l00348"></a>00348         tLeftBrace,
<a name="l00349"></a>00349         tRightBrace,
<a name="l00350"></a>00350         tSpace,
<a name="l00351"></a>00351         tOther
<a name="l00352"></a>00352     }CharacterClass;
<a name="l00353"></a>00353 
<a name="l00354"></a>00354     <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> pattern;
<a name="l00355"></a>00355     <span class="comment">//Hash to store the keyword, phrase pairs.</span>
<a name="l00356"></a>00356     Hashtable  *parsedValuesHash;
<a name="l00357"></a>00357 
<a name="l00358"></a>00358     <a class="code" href="classSelectFormat.html">SelectFormat</a>();   <span class="comment">// default constructor not implemented.</span>
<a name="l00359"></a>00359     <span class="keywordtype">void</span> init(<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>&amp; status);
<a name="l00360"></a>00360     <span class="comment">//For the applyPattern , classifies char.s in one of the characterClass.</span>
<a name="l00361"></a>00361     CharacterClass classifyCharacter(<a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac" title="Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned...">UChar</a> ch) <span class="keyword">const</span>;
<a name="l00362"></a>00362     <span class="comment">//Checks if the &quot;other&quot; keyword is present in pattern.</span>
<a name="l00363"></a>00363     <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> checkSufficientDefinition();
<a name="l00364"></a>00364     <span class="comment">//Checks if the keyword passed is valid.</span>
<a name="l00365"></a>00365     <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> checkValidKeyword(<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>&amp; argKeyword) <span class="keyword">const</span>;
<a name="l00366"></a>00366     <span class="keywordtype">void</span> parsingFailure();
<a name="l00367"></a>00367     <span class="keywordtype">void</span> copyHashtable(Hashtable *other, <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>&amp; status);
<a name="l00368"></a>00368 };
<a name="l00369"></a>00369 
<a name="l00370"></a>00370 <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="l00371"></a>00371 
<a name="l00372"></a>00372 <span class="preprocessor">#endif </span><span class="comment">/* #if !UCONFIG_NO_FORMATTING */</span>
<a name="l00373"></a>00373 
<a name="l00374"></a>00374 <span class="preprocessor">#endif // _SELFMT</span>
<a name="l00375"></a>00375 <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">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</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 size="1"/><address style="text-align: right;"><small>Generated on 16 Mar 2010 for ICU 4.4 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>