Sophie

Sophie

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

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: SelectFormat Class Reference</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 class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><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="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>SelectFormat Class Reference</h1><!-- doxytag: class="SelectFormat" --><!-- doxytag: inherits="Format" -->
<p><code>#include &lt;<a class="el" href="selfmt_8h_source.html">selfmt.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for SelectFormat:</div>
<div class="dynsection">
 <div class="center">
  <img src="classSelectFormat.gif" usemap="#SelectFormat_map" alt=""/>
  <map id="SelectFormat_map" name="SelectFormat_map">
<area href="classFormat.html" alt="Format" shape="rect" coords="0,112,86,136"/>
<area href="classUObject.html" alt="UObject" shape="rect" coords="0,56,86,80"/>
<area href="classUMemory.html" alt="UMemory" shape="rect" coords="0,0,86,24"/>
</map>
 </div>
</div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a2ec2860c36e0f125426b0ecaefd97296">SelectFormat</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> for a given pattern string.  <a href="#a2ec2860c36e0f125426b0ecaefd97296"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a1b72b5353e11530dff1c328e6b5847fe">SelectFormat</a> (const <a class="el" href="classSelectFormat.html">SelectFormat</a> &amp;other)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">copy constructor.  <a href="#a1b72b5353e11530dff1c328e6b5847fe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a51ff92529043981b3f8aca7dc5370706">~SelectFormat</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#a51ff92529043981b3f8aca7dc5370706"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a71d9a1c62fecb1b2b57ccea6c79dc772">applyPattern</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the pattern used by this select format.  <a href="#a71d9a1c62fecb1b2b57ccea6c79dc772"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a838bf974ccae954fd31e03a51f412f94">format</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;keyword, <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;appendTo, <a class="el" href="classFieldPosition.html">FieldPosition</a> &amp;pos, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Selects the phrase for the given keyword.  <a href="#a838bf974ccae954fd31e03a51f412f94"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSelectFormat.html">SelectFormat</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#aa1d4bff5798ca8a37d3da8f6ac6ea13d">operator=</a> (const <a class="el" href="classSelectFormat.html">SelectFormat</a> &amp;other)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment operator.  <a href="#aa1d4bff5798ca8a37d3da8f6ac6ea13d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a2eb7899f4528b6b229f347cf3095fde4">operator==</a> (const <a class="el" href="classFormat.html">Format</a> &amp;other) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return true if another object is semantically equal to this one.  <a href="#a2eb7899f4528b6b229f347cf3095fde4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a1d33c693a2df1dbdc973dcc12afbb5b0">operator!=</a> (const <a class="el" href="classFormat.html">Format</a> &amp;other) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return true if another object is semantically unequal to this one.  <a href="#a1d33c693a2df1dbdc973dcc12afbb5b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classFormat.html">Format</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a93921b5dd473d831353fc489ab2f1afc">clone</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clones this <a class="el" href="classFormat.html" title="Base class for all formats.">Format</a> object polymorphically.  <a href="#a93921b5dd473d831353fc489ab2f1afc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#aedd16cf657cb9146811f5f3e31dfa9f2">format</a> (const <a class="el" href="classFormattable.html">Formattable</a> &amp;obj, <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;appendTo, <a class="el" href="classFieldPosition.html">FieldPosition</a> &amp;pos, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classFormat.html" title="Base class for all formats.">Format</a> an object to produce a string.  <a href="#aedd16cf657cb9146811f5f3e31dfa9f2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#af6ae2bd247711b12cef03f81c1c41dc3">toPattern</a> (<a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;appendTo)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the pattern from <a class="el" href="classSelectFormat.html#a71d9a1c62fecb1b2b57ccea6c79dc772" title="Sets the pattern used by this select format.">applyPattern()</a> or constructor.  <a href="#af6ae2bd247711b12cef03f81c1c41dc3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a7e36d9ad29f4c443ddd2ed1c40c63fc4">parseObject</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;source, <a class="el" href="classFormattable.html">Formattable</a> &amp;result, <a class="el" href="classParsePosition.html">ParsePosition</a> &amp;parse_pos) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not yet supported by <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code>.  <a href="#a7e36d9ad29f4c443ddd2ed1c40c63fc4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a5c0716bdea388c31fee8f051307609cf">getDynamicClassID</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for the actual class.  <a href="#a5c0716bdea388c31fee8f051307609cf"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSelectFormat.html#a1d8ac9150eb3cf314852c9579898bbe2">getStaticClassID</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for this class.  <a href="#a1d8ac9150eb3cf314852c9579898bbe2"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> supports the creation of internationalized messages by selecting phrases based on keywords. The pattern specifies how to map keywords to phrases and provides a default phrase. The object provided to the format method is a string that's matched against the keywords. If there is a match, the corresponding phrase is selected; otherwise, the default phrase is used.</p>
<h4>Using <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> for Gender Agreement</h4>
<p>The main use case for the select format is gender based inflection. When names or nouns are inserted into sentences, their gender can affect pronouns, verb forms, articles, and adjectives. Special care needs to be taken for the case where the gender cannot be determined. The impact varies between languages:  
 <ul>
 <li>English has three genders, and unknown gender is handled as a  special
 case. Names use the gender of the named person (if known), nouns  referring
 to people use natural gender, and inanimate objects are usually  neutral.
 The gender only affects pronouns: "he", "she", "it", "they".

 <li>German differs from English in that the gender of nouns is  rather
 arbitrary, even for nouns referring to people ("M&#x00E4;dchen", girl, is  neutral).
 The gender affects pronouns ("er", "sie", "es"), articles ("der",  "die",
 "das"), and adjective forms ("guter Mann", "gute Frau", "gutes  M&#x00E4;dchen").

 <li>French has only two genders; as in German the gender of nouns
 is rather arbitrary - for sun and moon, the genders
 are the opposite of those in German. The gender affects
 pronouns ("il", "elle"), articles ("le", "la"),
 adjective forms ("bon", "bonne"), and sometimes
 verb forms ("all&#x00E9;", "all&#x00E9;e").

 <li>Polish distinguishes five genders (or noun classes),
 human masculine, animate non-human masculine, inanimate masculine,
 feminine, and neuter.
 </ul>
  <p>Some other languages have noun classes that are not related to gender, but similar in grammatical use. Some African languages have around 20 noun classes.</p>
<p>To enable localizers to create sentence patterns that take their language's gender dependencies into consideration, software has to provide information about the gender associated with a noun or name to <code><a class="el" href="classMessageFormat.html" title="MessageFormat produces concatenated messages in a language-neutral way.">MessageFormat</a></code>. Two main cases can be distinguished:</p>
<ul>
<li>
<p class="startli">For people, natural gender information should be maintained for each person. The keywords "male", "female", "mixed" (for groups of people) and "unknown" are used.</p>
<p class="endli"></p>
</li>
<li>
For nouns, grammatical gender information should be maintained for each noun and per language, e.g., in resource bundles. The keywords "masculine", "feminine", and "neuter" are commonly used, but some languages may require other keywords. </li>
</ul>
<p>The resulting keyword is provided to <code><a class="el" href="classMessageFormat.html" title="MessageFormat produces concatenated messages in a language-neutral way.">MessageFormat</a></code> as a parameter separate from the name or noun it's associated with. For example, to generate a message such as "Jean went to Paris", three separate arguments would be provided: The name of the person as argument 0, the gender of the person as argument 1, and the name of the city as argument 2. The sentence pattern for English, where the gender of the person has no impact on this simple sentence, would not refer to argument 1 at all:</p>
<pre>{0} went to {2}.</pre><p>The sentence pattern for French, where the gender of the person affects the form of the participle, uses a select format based on argument 1:</p>
 <pre>{0} est {1, select, female {all&#x00E9;e} other {all&#x00E9;}} &#x00E0; {2}.</pre><p>Patterns can be nested, so that it's possible to handle interactions of number and gender where necessary. For example, if the above sentence should allow for the names of several people to be inserted, the following sentence pattern can be used (with argument 0 the list of people's names, argument 1 the number of people, argument 2 their combined gender, and argument 3 the city name):</p>
 
 <pre>{0} {1, plural,
                 one {est {2, select, female {all&#x00E9;e} other  {all&#x00E9;}}}
                 other {sont {2, select, female {all&#x00E9;es} other {all&#x00E9;s}}}
          }&#x00E0; {3}.</pre>
 <h4>Patterns and Their Interpretation</h4>
<p>The <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> pattern text defines the phrase output for each user-defined keyword. The pattern is a sequence of <code><em>keyword</em>{<em>phrase</em>}</code> clauses. Each clause assigns the phrase <code><em>phrase</em></code> to the user-defined <code><em>keyword</em></code>.</p>
<p>Keywords must match the pattern [a-zA-Z][a-zA-Z0-9_-]*; keywords that don't match this pattern result in the error code <code>U_ILLEGAL_CHARACTER</code>. You always have to define a phrase for the default keyword <code>other</code>; this phrase is returned when the keyword provided to the <code>format</code> method matches no other keyword. If a pattern does not provide a phrase for <code>other</code>, the method it's provided to returns the error <code>U_DEFAULT_KEYWORD_MISSING</code>. If a pattern provides more than one phrase for the same keyword, the error <code>U_DUPLICATE_KEYWORD</code> is returned. <br/>
 Spaces between <code><em>keyword</em></code> and <code>{<em>phrase</em>}</code> will be ignored; spaces within <code>{<em>phrase</em>}</code> will be preserved.</p>
<p>The phrase for a particular select case may contain other message format patterns. <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> preserves these so that you can use the strings produced by <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> with other formatters. If you are using <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> inside a <code><a class="el" href="classMessageFormat.html" title="MessageFormat produces concatenated messages in a language-neutral way.">MessageFormat</a></code> pattern, <code><a class="el" href="classMessageFormat.html" title="MessageFormat produces concatenated messages in a language-neutral way.">MessageFormat</a></code> will automatically evaluate the resulting format pattern. Thus, curly braces (<code>{</code>, <code>}</code>) are <em>only</em> allowed in phrases to define a nested format pattern.</p>
<p>Example:  

 UErrorCode status = U_ZERO_ERROR;
 MessageFormat *msgFmt = new MessageFormat(UnicodeString("{0} est  {1, select, female {all&#x00E9;e} other {all&#x00E9;}} &#x00E0; Paris."), Locale("fr"),  status);
 if (U_FAILURE(status)) {
       return;
 }
 FieldPosition ignore(FieldPosition::DONT_CARE);
 UnicodeString result;

 char* str1= "Kirti,female";
 Formattable args1[] = {"Kirti","female"};
 msgFmt->format(args1, 2, result, ignore, status);
 cout << "Input is " << str1 << " and result is: " << result << endl;
 delete msgFmt;

  <p>Produces the output:<br/>
  
 <code>Kirti est all&#x00E9;e &#x00E0; Paris.</code>
 <dl class="draft"><dt><b><a class="el" href="draft.html#_draft000182">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Definition at line <a class="el" href="selfmt_8h_source.html#l00184">184</a> of file <a class="el" href="selfmt_8h_source.html">selfmt.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2ec2860c36e0f125426b0ecaefd97296"></a><!-- doxytag: member="SelectFormat::SelectFormat" ref="a2ec2860c36e0f125426b0ecaefd97296" args="(const UnicodeString &amp;pattern, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SelectFormat::SelectFormat </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code> for a given pattern string. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>the pattern for this <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code>. errors are returned to status if the pattern is invalid. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>output param set to success/failure code on exit, which must not indicate a failure before the function call. </td></tr>
  </table>
  </dd>
</dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000183">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a1b72b5353e11530dff1c328e6b5847fe"></a><!-- doxytag: member="SelectFormat::SelectFormat" ref="a1b72b5353e11530dff1c328e6b5847fe" args="(const SelectFormat &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SelectFormat::SelectFormat </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSelectFormat.html">SelectFormat</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>copy constructor. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000184">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a51ff92529043981b3f8aca7dc5370706"></a><!-- doxytag: member="SelectFormat::~SelectFormat" ref="a51ff92529043981b3f8aca7dc5370706" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual SelectFormat::~SelectFormat </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000185">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a71d9a1c62fecb1b2b57ccea6c79dc772"></a><!-- doxytag: member="SelectFormat::applyPattern" ref="a71d9a1c62fecb1b2b57ccea6c79dc772" args="(const UnicodeString &amp;pattern, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SelectFormat::applyPattern </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the pattern used by this select format. </p>
<p>for the keyword rules. Patterns and their interpretation are specified in the class description.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>the pattern for this select format errors are returned to status if the pattern is invalid. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>output param set to success/failure code on exit, which must not indicate a failure before the function call. </td></tr>
  </table>
  </dd>
</dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000186">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a93921b5dd473d831353fc489ab2f1afc"></a><!-- doxytag: member="SelectFormat::clone" ref="a93921b5dd473d831353fc489ab2f1afc" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classFormat.html">Format</a>* SelectFormat::clone </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Clones this <a class="el" href="classFormat.html" title="Base class for all formats.">Format</a> object polymorphically. </p>
<p>The caller owns the result and should delete it when done. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000191">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Implements <a class="el" href="classFormat.html#a4e7ebd5cfd390c35e2bda88257f8b51a">Format</a>.</p>

</div>
</div>
<a class="anchor" id="aedd16cf657cb9146811f5f3e31dfa9f2"></a><!-- doxytag: member="SelectFormat::format" ref="aedd16cf657cb9146811f5f3e31dfa9f2" args="(const Formattable &amp;obj, UnicodeString &amp;appendTo, FieldPosition &amp;pos, UErrorCode &amp;status) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classUnicodeString.html">UnicodeString</a>&amp; SelectFormat::format </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classFormattable.html">Formattable</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>appendTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classFieldPosition.html">FieldPosition</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="classFormat.html" title="Base class for all formats.">Format</a> an object to produce a string. </p>
<p>This method handles keyword strings. If the <a class="el" href="classFormattable.html" title="Formattable objects can be passed to the Format class or its subclasses for formatting...">Formattable</a> object is not a <code><a class="el" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a></code>, then it returns a failing UErrorCode.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>obj</em>&nbsp;</td><td>A keyword string that is used to select an alternative. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>appendTo</em>&nbsp;</td><td>output parameter to receive result. Result is appended to existing contents. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>On input: an alignment field, if desired. On output: the offsets of the alignment field. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>output param filled with success/failure status. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Reference to 'appendTo' parameter. </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000192">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Implements <a class="el" href="classFormat.html#a12ffb857c5c9a553270dfe9a71fbd8e9">Format</a>.</p>

</div>
</div>
<a class="anchor" id="a838bf974ccae954fd31e03a51f412f94"></a><!-- doxytag: member="SelectFormat::format" ref="a838bf974ccae954fd31e03a51f412f94" args="(const UnicodeString &amp;keyword, UnicodeString &amp;appendTo, FieldPosition &amp;pos, UErrorCode &amp;status) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classUnicodeString.html">UnicodeString</a>&amp; SelectFormat::format </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>keyword</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>appendTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classFieldPosition.html">FieldPosition</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Selects the phrase for the given keyword. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>keyword</em>&nbsp;</td><td>The keyword that is used to select an alternative. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>appendTo</em>&nbsp;</td><td>output parameter to receive result. result is appended to existing contents. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>On input: an alignment field, if desired. On output: the offsets of the alignment field. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>output param set to success/failure code on exit, which must not indicate a failure before the function call. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Reference to 'appendTo' parameter. </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000187">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a5c0716bdea388c31fee8f051307609cf"></a><!-- doxytag: member="SelectFormat::getDynamicClassID" ref="a5c0716bdea388c31fee8f051307609cf" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> SelectFormat::getDynamicClassID </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>ICU "poor man's RTTI", returns a UClassID for the actual class. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000196">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Implements <a class="el" href="classFormat.html#ac961d410d174518e5a3ebb8bbef45cd7">Format</a>.</p>

</div>
</div>
<a class="anchor" id="a1d8ac9150eb3cf314852c9579898bbe2"></a><!-- doxytag: member="SelectFormat::getStaticClassID" ref="a1d8ac9150eb3cf314852c9579898bbe2" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> SelectFormat::getStaticClassID </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>ICU "poor man's RTTI", returns a UClassID for this class. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000195">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a1d33c693a2df1dbdc973dcc12afbb5b0"></a><!-- doxytag: member="SelectFormat::operator!=" ref="a1d33c693a2df1dbdc973dcc12afbb5b0" args="(const Format &amp;other) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> SelectFormat::operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classFormat.html">Format</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return true if another object is semantically unequal to this one. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>other</em>&nbsp;</td><td>the <a class="el" href="classSelectFormat.html">SelectFormat</a> object to be compared with. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if other is semantically unequal to this. </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000190">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="aa1d4bff5798ca8a37d3da8f6ac6ea13d"></a><!-- doxytag: member="SelectFormat::operator=" ref="aa1d4bff5798ca8a37d3da8f6ac6ea13d" args="(const SelectFormat &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSelectFormat.html">SelectFormat</a>&amp; SelectFormat::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSelectFormat.html">SelectFormat</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Assignment operator. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>other</em>&nbsp;</td><td>the <a class="el" href="classSelectFormat.html">SelectFormat</a> object to copy from. </td></tr>
  </table>
  </dd>
</dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000188">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Reimplemented from <a class="el" href="classFormat.html#a7a5276a88c488462eea3a508b71f4d9c">Format</a>.</p>

</div>
</div>
<a class="anchor" id="a2eb7899f4528b6b229f347cf3095fde4"></a><!-- doxytag: member="SelectFormat::operator==" ref="a2eb7899f4528b6b229f347cf3095fde4" args="(const Format &amp;other) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> SelectFormat::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classFormat.html">Format</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return true if another object is semantically equal to this one. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>other</em>&nbsp;</td><td>the <a class="el" href="classSelectFormat.html">SelectFormat</a> object to be compared with. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if other is semantically equal to this. </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000189">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<a class="anchor" id="a7e36d9ad29f4c443ddd2ed1c40c63fc4"></a><!-- doxytag: member="SelectFormat::parseObject" ref="a7e36d9ad29f4c443ddd2ed1c40c63fc4" args="(const UnicodeString &amp;source, Formattable &amp;result, ParsePosition &amp;parse_pos) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void SelectFormat::parseObject </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classFormattable.html">Formattable</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classParsePosition.html">ParsePosition</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parse_pos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This method is not yet supported by <code><a class="el" href="classSelectFormat.html">SelectFormat</a></code>. </p>
<p>Before calling, set parse_pos.index to the offset you want to start parsing at in the source. After calling, parse_pos.index is the end of the text you parsed. If error occurs, index is unchanged. </p>
<p>When parsing, leading whitespace is discarded (with a successful parse), while trailing whitespace is left as is. </p>
<p>See <a class="el" href="classFormat.html#aa53bea97b986c2f21e5638aa30aa08b7" title="Parse a string to produce an object.">Format::parseObject()</a> for more.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>source</em>&nbsp;</td><td>The string to be parsed into an object. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>result</em>&nbsp;</td><td><a class="el" href="classFormattable.html" title="Formattable objects can be passed to the Format class or its subclasses for formatting...">Formattable</a> to be set to the parse result. If parse fails, return contents are undefined. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>parse_pos</em>&nbsp;</td><td>The position to start parsing at. Upon return this param is set to the position after the last character successfully parsed. If the source is not parsed successfully, this param will remain unchanged. </td></tr>
  </table>
  </dd>
</dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000194">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

<p>Implements <a class="el" href="classFormat.html#aa53bea97b986c2f21e5638aa30aa08b7">Format</a>.</p>

</div>
</div>
<a class="anchor" id="af6ae2bd247711b12cef03f81c1c41dc3"></a><!-- doxytag: member="SelectFormat::toPattern" ref="af6ae2bd247711b12cef03f81c1c41dc3" args="(UnicodeString &amp;appendTo)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classUnicodeString.html">UnicodeString</a>&amp; SelectFormat::toPattern </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>appendTo</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the pattern from <a class="el" href="classSelectFormat.html#a71d9a1c62fecb1b2b57ccea6c79dc772" title="Sets the pattern used by this select format.">applyPattern()</a> or constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>appendTo</em>&nbsp;</td><td>output parameter to receive result. Result is appended to existing contents. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the <a class="el" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> with inserted pattern. </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000193">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.4 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="selfmt_8h_source.html">selfmt.h</a></li>
</ul>
</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>