<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>ICU 58.2: uenum.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">ICU 58.2  <span id="projectnumber">58.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <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="namespaces.html"><span>Namespaces</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> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li><li class="navelem"><a class="el" href="dir_30087b5439e04c85304dbcf15650710b.html">common</a></li><li class="navelem"><a class="el" href="dir_8bf9c54ed6ca2fd1e2117fb037e4ad06.html">unicode</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#namespaces">Namespaces</a> | <a href="#typedef-members">Typedefs</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">uenum.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>C API: String Enumeration. <a href="#details">More...</a></p> <div class="textblock"><code>#include "<a class="el" href="utypes_8h_source.html">unicode/utypes.h</a>"</code><br /> <code>#include "<a class="el" href="localpointer_8h_source.html">unicode/localpointer.h</a>"</code><br /> <code>#include "<a class="el" href="strenum_8h_source.html">unicode/strenum.h</a>"</code><br /> </div> <p><a href="uenum_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a> Namespaces</h2></td></tr> <tr class="memitem:namespaceicu"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceicu.html">icu</a></td></tr> <tr class="memdesc:namespaceicu"><td class="mdescLeft"> </td><td class="mdescRight">File <a class="el" href="coll_8h.html" title="C++ API: Collation Service. ">coll.h</a>. <br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:a32b7253b2148022535be36a9fcdb5a8d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a></td></tr> <tr class="memdesc:a32b7253b2148022535be36a9fcdb5a8d"><td class="mdescLeft"> </td><td class="mdescRight">structure representing an enumeration object instance <a href="#a32b7253b2148022535be36a9fcdb5a8d">More...</a><br /></td></tr> <tr class="separator:a32b7253b2148022535be36a9fcdb5a8d"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:af8bf1abcf3a486f07ee3384c7fce89df"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#af8bf1abcf3a486f07ee3384c7fce89df">uenum_close</a> (<a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *en)</td></tr> <tr class="memdesc:af8bf1abcf3a486f07ee3384c7fce89df"><td class="mdescLeft"> </td><td class="mdescRight">Disposes of resources in use by the iterator. <a href="#af8bf1abcf3a486f07ee3384c7fce89df">More...</a><br /></td></tr> <tr class="separator:af8bf1abcf3a486f07ee3384c7fce89df"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8be6db20419d79ecdd71e717a9521773"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a8be6db20419d79ecdd71e717a9521773">uenum_count</a> (<a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *en, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:a8be6db20419d79ecdd71e717a9521773"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of elements that the iterator traverses. <a href="#a8be6db20419d79ecdd71e717a9521773">More...</a><br /></td></tr> <tr class="separator:a8be6db20419d79ecdd71e717a9521773"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af7afc38ba0ea6071b03b052209e2e07d"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#af7afc38ba0ea6071b03b052209e2e07d">uenum_unext</a> (<a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *en, int32_t *resultLength, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:af7afc38ba0ea6071b03b052209e2e07d"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next element in the iterator's list. <a href="#af7afc38ba0ea6071b03b052209e2e07d">More...</a><br /></td></tr> <tr class="separator:af7afc38ba0ea6071b03b052209e2e07d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a99298eabaa3874cdfd9793b207848f68"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a99298eabaa3874cdfd9793b207848f68">uenum_next</a> (<a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *en, int32_t *resultLength, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:a99298eabaa3874cdfd9793b207848f68"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next element in the iterator's list. <a href="#a99298eabaa3874cdfd9793b207848f68">More...</a><br /></td></tr> <tr class="separator:a99298eabaa3874cdfd9793b207848f68"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a76b3866509601b228ee72fa4089107bb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a76b3866509601b228ee72fa4089107bb">uenum_reset</a> (<a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *en, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:a76b3866509601b228ee72fa4089107bb"><td class="mdescLeft"> </td><td class="mdescRight">Resets the iterator to the current list of service IDs. <a href="#a76b3866509601b228ee72fa4089107bb">More...</a><br /></td></tr> <tr class="separator:a76b3866509601b228ee72fa4089107bb"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a88072e393a0901f374bb09859dc1e093"><td class="memItemLeft" align="right" valign="top"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a88072e393a0901f374bb09859dc1e093">uenum_openFromStringEnumeration</a> (<a class="el" href="classicu_1_1StringEnumeration.html">icu::StringEnumeration</a> *adopted, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *ec)</td></tr> <tr class="memdesc:a88072e393a0901f374bb09859dc1e093"><td class="mdescLeft"> </td><td class="mdescRight">Given a StringEnumeration, wrap it in a UEnumeration. <a href="#a88072e393a0901f374bb09859dc1e093">More...</a><br /></td></tr> <tr class="separator:a88072e393a0901f374bb09859dc1e093"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aaa11700a992ef714551e6a2ae001b091"><td class="memItemLeft" align="right" valign="top"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#aaa11700a992ef714551e6a2ae001b091">uenum_openUCharStringsEnumeration</a> (const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *const strings[], int32_t count, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *ec)</td></tr> <tr class="memdesc:aaa11700a992ef714551e6a2ae001b091"><td class="mdescLeft"> </td><td class="mdescRight">Given an array of const UChar* strings, return a UEnumeration. <a href="#aaa11700a992ef714551e6a2ae001b091">More...</a><br /></td></tr> <tr class="separator:aaa11700a992ef714551e6a2ae001b091"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a89298631a5febaa31b04cf7982e2d1f7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="uenum_8h.html#a89298631a5febaa31b04cf7982e2d1f7">uenum_openCharStringsEnumeration</a> (const char *const strings[], int32_t count, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *ec)</td></tr> <tr class="memdesc:a89298631a5febaa31b04cf7982e2d1f7"><td class="mdescLeft"> </td><td class="mdescRight">Given an array of const char* strings (invariant chars only), return a UEnumeration. <a href="#a89298631a5febaa31b04cf7982e2d1f7">More...</a><br /></td></tr> <tr class="separator:a89298631a5febaa31b04cf7982e2d1f7"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>C API: String Enumeration. </p> <p>Definition in file <a class="el" href="uenum_8h_source.html">uenum.h</a>.</p> </div><h2 class="groupheader">Typedef Documentation</h2> <a class="anchor" id="a32b7253b2148022535be36a9fcdb5a8d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> <a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a></td> </tr> </table> </div><div class="memdoc"> <p>structure representing an enumeration object instance </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001723">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> <p>Definition at line <a class="el" href="uenum_8h_source.html#l00041">41</a> of file <a class="el" href="uenum_8h_source.html">uenum.h</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="af8bf1abcf3a486f07ee3384c7fce89df"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void uenum_close </td> <td>(</td> <td class="paramtype"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td> <td class="paramname"><em>en</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Disposes of resources in use by the iterator. </p> <p>If en is NULL, does nothing. After this call, any char* or UChar* pointer returned by <a class="el" href="uenum_8h.html#af7afc38ba0ea6071b03b052209e2e07d" title="Returns the next element in the iterator's list. ">uenum_unext()</a> or <a class="el" href="uenum_8h.html#a99298eabaa3874cdfd9793b207848f68" title="Returns the next element in the iterator's list. ">uenum_next()</a> is invalid. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">en</td><td>UEnumeration structure pointer </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001724">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> </div> </div> <a class="anchor" id="a8be6db20419d79ecdd71e717a9521773"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t uenum_count </td> <td>(</td> <td class="paramtype"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td> <td class="paramname"><em>en</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>status</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Returns the number of elements that the iterator traverses. </p> <p>If the iterator is out-of-sync with its service, status is set to U_ENUM_OUT_OF_SYNC_ERROR. This is a convenience function. It can end up being very expensive as all the items might have to be pre-fetched (depending on the type of data being traversed). Use with caution and only when necessary. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">en</td><td>UEnumeration structure pointer </td></tr> <tr><td class="paramname">status</td><td>error code, can be U_ENUM_OUT_OF_SYNC_ERROR if the iterator is out of sync. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>number of elements in the iterator </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001725">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> </div> </div> <a class="anchor" id="a99298eabaa3874cdfd9793b207848f68"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* uenum_next </td> <td>(</td> <td class="paramtype"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td> <td class="paramname"><em>en</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t * </td> <td class="paramname"><em>resultLength</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>status</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Returns the next element in the iterator's list. </p> <p>If there are no more elements, returns NULL. If the iterator is out-of-sync with its service, status is set to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned. If the native service string is a UChar* string, it is converted to char* with the invariant converter. The result is terminated by (char)0. If the conversion fails (because a character cannot be converted) then status is set to U_INVARIANT_CONVERSION_ERROR and the return value is undefined (but non-NULL). </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">en</td><td>the iterator object </td></tr> <tr><td class="paramname">resultLength</td><td>pointer to receive the length of the result (not including the terminating \0). If the pointer is NULL it is ignored. </td></tr> <tr><td class="paramname">status</td><td>the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if the iterator is out of sync with its service. Set to U_INVARIANT_CONVERSION_ERROR if the underlying native string is UChar* and conversion to char* with the invariant converter fails. This error pertains only to current string, so iteration might be able to continue successfully. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a pointer to the string. The string will be zero-terminated. The return pointer is owned by this iterator and must not be deleted by the caller. The pointer is valid until the next call to any uenum_... method, including <a class="el" href="uenum_8h.html#a99298eabaa3874cdfd9793b207848f68" title="Returns the next element in the iterator's list. ">uenum_next()</a> or <a class="el" href="uenum_8h.html#af7afc38ba0ea6071b03b052209e2e07d" title="Returns the next element in the iterator's list. ">uenum_unext()</a>. When all strings have been traversed, returns NULL. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001727">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> </div> </div> <a class="anchor" id="a89298631a5febaa31b04cf7982e2d1f7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a>* uenum_openCharStringsEnumeration </td> <td>(</td> <td class="paramtype">const char *const </td> <td class="paramname"><em>strings</em>[], </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>count</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>ec</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Given an array of const char* strings (invariant chars only), return a UEnumeration. </p> <p>String pointers from 0..count-1 must not be null. Do not free or modify either the string array or the characters it points to until this object has been destroyed with uenum_close. </p><div class="fragment"><div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span>* strings[] = { <span class="stringliteral">"Firstly"</span>, <span class="stringliteral">"Secondly"</span>, <span class="stringliteral">"Thirdly"</span>, <span class="stringliteral">"Fourthly"</span> };</div><div class="line"> <a class="code" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *u = <a class="code" href="uenum_8h.html#a89298631a5febaa31b04cf7982e2d1f7">uenum_openCharStringsEnumeration</a>(strings, 4, &status);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">strings</td><td>array of char* strings (each null terminated). All storage is owned by the caller. </td></tr> <tr><td class="paramname">count</td><td>length of the array </td></tr> <tr><td class="paramname">ec</td><td>error code </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the new UEnumeration object. Caller is responsible for calling uenum_close to free memory </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="uenum_8h.html#af8bf1abcf3a486f07ee3384c7fce89df" title="Disposes of resources in use by the iterator. ">uenum_close</a> </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001731">Stable:</a></b></dt><dd>ICU 50 </dd></dl> </div> </div> <a class="anchor" id="a88072e393a0901f374bb09859dc1e093"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a>* uenum_openFromStringEnumeration </td> <td>(</td> <td class="paramtype"><a class="el" href="classicu_1_1StringEnumeration.html">icu::StringEnumeration</a> * </td> <td class="paramname"><em>adopted</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>ec</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Given a StringEnumeration, wrap it in a UEnumeration. </p> <p>The StringEnumeration is adopted; after this call, the caller must not delete it (regardless of error status). </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">adopted</td><td>the C++ StringEnumeration to be wrapped in a UEnumeration. </td></tr> <tr><td class="paramname">ec</td><td>the error code. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a UEnumeration wrapping the adopted StringEnumeration. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001729">Stable:</a></b></dt><dd>ICU 4.2 </dd></dl> </div> </div> <a class="anchor" id="aaa11700a992ef714551e6a2ae001b091"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a>* uenum_openUCharStringsEnumeration </td> <td>(</td> <td class="paramtype">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *const </td> <td class="paramname"><em>strings</em>[], </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>count</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>ec</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Given an array of const UChar* strings, return a UEnumeration. </p> <p>String pointers from 0..count-1 must not be null. Do not free or modify either the string array or the characters it points to until this object has been destroyed with uenum_close. </p><div class="fragment"><div class="line"> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> nko_1[] = {0x07c1,0}, nko_2[] = {0x07c2,0}, nko_3[] = {0x07c3,0}, nko_4[] = {0x07c4,0};</div><div class="line"> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>* ustrings[] = { nko_1, nko_2, nko_3, nko_4 };</div><div class="line"> <a class="code" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> *u = <a class="code" href="uenum_8h.html#aaa11700a992ef714551e6a2ae001b091">uenum_openUCharStringsEnumeration</a>(ustrings, 4, &status);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">strings</td><td>array of const UChar* strings (each null terminated). All storage is owned by the caller. </td></tr> <tr><td class="paramname">count</td><td>length of the array </td></tr> <tr><td class="paramname">ec</td><td>error code </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the new UEnumeration object. Caller is responsible for calling uenum_close to free memory. </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="uenum_8h.html#af8bf1abcf3a486f07ee3384c7fce89df" title="Disposes of resources in use by the iterator. ">uenum_close</a> </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001730">Stable:</a></b></dt><dd>ICU 50 </dd></dl> </div> </div> <a class="anchor" id="a76b3866509601b228ee72fa4089107bb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void uenum_reset </td> <td>(</td> <td class="paramtype"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td> <td class="paramname"><em>en</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>status</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Resets the iterator to the current list of service IDs. </p> <p>This re-establishes sync with the service and rewinds the iterator to start at the first element. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">en</td><td>the iterator object </td></tr> <tr><td class="paramname">status</td><td>the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if the iterator is out of sync with its service. </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001728">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> </div> </div> <a class="anchor" id="af7afc38ba0ea6071b03b052209e2e07d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>* uenum_unext </td> <td>(</td> <td class="paramtype"><a class="el" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d">UEnumeration</a> * </td> <td class="paramname"><em>en</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t * </td> <td class="paramname"><em>resultLength</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * </td> <td class="paramname"><em>status</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Returns the next element in the iterator's list. </p> <p>If there are no more elements, returns NULL. If the iterator is out-of-sync with its service, status is set to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned. If the native service string is a char* string, it is converted to UChar* with the invariant converter. The result is terminated by (UChar)0. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">en</td><td>the iterator object </td></tr> <tr><td class="paramname">resultLength</td><td>pointer to receive the length of the result (not including the terminating \0). If the pointer is NULL it is ignored. </td></tr> <tr><td class="paramname">status</td><td>the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if the iterator is out of sync with its service. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a pointer to the string. The string will be zero-terminated. The return pointer is owned by this iterator and must not be deleted by the caller. The pointer is valid until the next call to any uenum_... method, including <a class="el" href="uenum_8h.html#a99298eabaa3874cdfd9793b207848f68" title="Returns the next element in the iterator's list. ">uenum_next()</a> or <a class="el" href="uenum_8h.html#af7afc38ba0ea6071b03b052209e2e07d" title="Returns the next element in the iterator's list. ">uenum_unext()</a>. When all strings have been traversed, returns NULL. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001726">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>