<!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: ulistformatter.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">ulistformatter.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>C API: Format a list in a locale-appropriate way. <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 /> </div> <p><a href="ulistformatter_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:a31361ae522dfc4f114ef417724d7649d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a></td></tr> <tr class="memdesc:a31361ae522dfc4f114ef417724d7649d"><td class="mdescLeft"> </td><td class="mdescRight">C typedef for struct UListFormatter. <a href="#a31361ae522dfc4f114ef417724d7649d">More...</a><br /></td></tr> <tr class="separator:a31361ae522dfc4f114ef417724d7649d"><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:a84e77b8ec940dbbc5e6399cc3c64bf7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="ulistformatter_8h.html#a84e77b8ec940dbbc5e6399cc3c64bf7c">ulistfmt_open</a> (const char *locale, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:a84e77b8ec940dbbc5e6399cc3c64bf7c"><td class="mdescLeft"> </td><td class="mdescRight">Open a new UListFormatter object using the rules for a given locale. <a href="#a84e77b8ec940dbbc5e6399cc3c64bf7c">More...</a><br /></td></tr> <tr class="separator:a84e77b8ec940dbbc5e6399cc3c64bf7c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa0282980b2964116a10efe30907fef2c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="ulistformatter_8h.html#aa0282980b2964116a10efe30907fef2c">ulistfmt_close</a> (<a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> *listfmt)</td></tr> <tr class="memdesc:aa0282980b2964116a10efe30907fef2c"><td class="mdescLeft"> </td><td class="mdescRight">Close a UListFormatter object. <a href="#aa0282980b2964116a10efe30907fef2c">More...</a><br /></td></tr> <tr class="separator:aa0282980b2964116a10efe30907fef2c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1660fdf1739555b2157b56f65db00372"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="ulistformatter_8h.html#a1660fdf1739555b2157b56f65db00372">ulistfmt_format</a> (const <a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> *listfmt, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *const strings[], const int32_t *stringLengths, int32_t stringCount, <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *result, int32_t resultCapacity, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *status)</td></tr> <tr class="memdesc:a1660fdf1739555b2157b56f65db00372"><td class="mdescLeft"> </td><td class="mdescRight">Formats a list of strings using the conventions established for the UListFormatter object. <a href="#a1660fdf1739555b2157b56f65db00372">More...</a><br /></td></tr> <tr class="separator:a1660fdf1739555b2157b56f65db00372"><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: Format a list in a locale-appropriate way. </p> <p>A UListFormatter is used to format a list of items in a locale-appropriate way, using data from CLDR. Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted as "Alice, Bob, Charlie, and Delta" in English. </p> <p>Definition in file <a class="el" href="ulistformatter_8h_source.html">ulistformatter.h</a>.</p> </div><h2 class="groupheader">Typedef Documentation</h2> <a class="anchor" id="a31361ae522dfc4f114ef417724d7649d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> <a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a></td> </tr> </table> </div><div class="memdoc"> <p>C typedef for struct UListFormatter. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001836">Stable:</a></b></dt><dd>ICU 55 </dd></dl> <p>Definition at line <a class="el" href="ulistformatter_8h_source.html#l00034">34</a> of file <a class="el" href="ulistformatter_8h_source.html">ulistformatter.h</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="aa0282980b2964116a10efe30907fef2c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ulistfmt_close </td> <td>(</td> <td class="paramtype"><a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> * </td> <td class="paramname"><em>listfmt</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Close a UListFormatter object. </p> <p>Once closed it may no longer be used. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">listfmt</td><td>The UListFormatter object to close. </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001838">Stable:</a></b></dt><dd>ICU 55 </dd></dl> </div> </div> <a class="anchor" id="a1660fdf1739555b2157b56f65db00372"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t ulistfmt_format </td> <td>(</td> <td class="paramtype">const <a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a> * </td> <td class="paramname"><em>listfmt</em>, </td> </tr> <tr> <td class="paramkey"></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">const int32_t * </td> <td class="paramname"><em>stringLengths</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>stringCount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td> <td class="paramname"><em>result</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>resultCapacity</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>Formats a list of strings using the conventions established for the UListFormatter object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">listfmt</td><td>The UListFormatter object specifying the list conventions. </td></tr> <tr><td class="paramname">strings</td><td>An array of pointers to UChar strings; the array length is specified by stringCount. Must be non-NULL if stringCount > 0. </td></tr> <tr><td class="paramname">stringLengths</td><td>An array of string lengths corresponding to the strings[] parameter; any individual length value may be negative to indicate that the corresponding strings[] entry is 0-terminated, or stringLengths itself may be NULL if all of the strings are 0-terminated. If non-NULL, the stringLengths array must have stringCount entries. </td></tr> <tr><td class="paramname">stringCount</td><td>the number of entries in strings[], and the number of entries in the stringLengths array if it is not NULL. Must be >= 0. </td></tr> <tr><td class="paramname">result</td><td>A pointer to a buffer to receive the formatted list. </td></tr> <tr><td class="paramname">resultCapacity</td><td>The maximum size of result. </td></tr> <tr><td class="paramname">status</td><td>A pointer to a standard ICU UErrorCode (input/output parameter). Its input value must pass the <a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success? ">U_SUCCESS()</a> test, or else the function returns immediately. The caller should check its output value with <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure? ">U_FAILURE()</a>, or use with function chaining (see User Guide for details). </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The total buffer size needed; if greater than resultLength, the output was truncated. May be <=0 if unable to determine the total buffer size needed (e.g. for illegal arguments). </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001839">Stable:</a></b></dt><dd>ICU 55 </dd></dl> </div> </div> <a class="anchor" id="a84e77b8ec940dbbc5e6399cc3c64bf7c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="ulistformatter_8h.html#a31361ae522dfc4f114ef417724d7649d">UListFormatter</a>* ulistfmt_open </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>locale</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>Open a new UListFormatter object using the rules for a given locale. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">locale</td><td>The locale whose rules should be used; may be NULL for default locale. </td></tr> <tr><td class="paramname">status</td><td>A pointer to a standard ICU UErrorCode (input/output parameter). Its input value must pass the <a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success? ">U_SUCCESS()</a> test, or else the function returns immediately. The caller should check its output value with <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure? ">U_FAILURE()</a>, or use with function chaining (see User Guide for details). </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A pointer to a UListFormatter object for the specified locale, or NULL if an error occurred. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001837">Stable:</a></b></dt><dd>ICU 55 </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>