<!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"/> <title>ICU 52.1: unistr.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 style="padding-left: 0.5em;"> <div id="projectname">ICU 52.1  <span id="projectnumber">52.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <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_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_f59c6450ff718ff1b085cfd1c36acbd7.html">unicode</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Data Structures</a> | <a href="#namespaces">Namespaces</a> | <a href="#define-members">Macros</a> | <a href="#typedef-members">Typedefs</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">unistr.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>C++ API: Unicode String. <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="rep_8h_source.html">unicode/rep.h</a>"</code><br/> <code>#include "<a class="el" href="std__string_8h_source.html">unicode/std_string.h</a>"</code><br/> <code>#include "<a class="el" href="stringpiece_8h_source.html">unicode/stringpiece.h</a>"</code><br/> <code>#include "<a class="el" href="bytestream_8h_source.html">unicode/bytestream.h</a>"</code><br/> <code>#include "<a class="el" href="ucasemap_8h_source.html">unicode/ucasemap.h</a>"</code><br/> </div> <p><a href="unistr_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a> Data Structures</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UnicodeString.html">icu::UnicodeString</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classicu_1_1UnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides similar function...">UnicodeString</a> is a string class that stores Unicode characters directly and provides similar functionality as the Java String and StringBuffer classes. <a href="classicu_1_1UnicodeString.html#details">More...</a><br/></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union  </td><td class="memItemRight" valign="bottom"><b>icu::UnicodeString::StackBufferOrFields</b></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="namespaces"></a> Namespaces</h2></td></tr> <tr class="memitem:namespaceicu"><td class="memItemLeft" align="right" valign="top">namespace  </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> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:a7fd781b068b28ee2db708090aa32df8f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#a7fd781b068b28ee2db708090aa32df8f">U_COMPARE_CODE_POINT_ORDER</a>   0x8000</td></tr> <tr class="memdesc:a7fd781b068b28ee2db708090aa32df8f"><td class="mdescLeft"> </td><td class="mdescRight">Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: Compare strings in code point order instead of code unit order. <a href="#a7fd781b068b28ee2db708090aa32df8f"></a><br/></td></tr> <tr class="memitem:ae90f6d771de19edc50bf989e607ddf19"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#ae90f6d771de19edc50bf989e607ddf19">U_STRING_CASE_MAPPER_DEFINED</a></td></tr> <tr class="memitem:a308c066384b8560030fb3482bcb13381"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#a308c066384b8560030fb3482bcb13381">US_INV</a>   <a class="el" href="classicu_1_1UnicodeString.html#a301902493406de453a439dfadfdd032fa050455dd0665a3c65d041ae02565f74b">icu::UnicodeString::kInvariant</a></td></tr> <tr class="memdesc:a308c066384b8560030fb3482bcb13381"><td class="mdescLeft"> </td><td class="mdescRight">Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a Unicode string from an invariant-character char * string. <a href="#a308c066384b8560030fb3482bcb13381"></a><br/></td></tr> <tr class="memitem:aeab1ff09f666cf5fce35fc88cf37d714"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#aeab1ff09f666cf5fce35fc88cf37d714">UNICODE_STRING</a>(cs, _length)   <a class="el" href="classicu_1_1UnicodeString.html">icu::UnicodeString</a>(<a class="el" href="umachine_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>, (const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *)L ## cs, _length)</td></tr> <tr class="memdesc:aeab1ff09f666cf5fce35fc88cf37d714"><td class="mdescLeft"> </td><td class="mdescRight">Unicode String literals in C++. <a href="#aeab1ff09f666cf5fce35fc88cf37d714"></a><br/></td></tr> <tr class="memitem:a6cd56429cbf4fe567a97c9d1a46e96ae"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#a6cd56429cbf4fe567a97c9d1a46e96ae">UNICODE_STRING_SIMPLE</a>(cs)   <a class="el" href="unistr_8h.html#aeab1ff09f666cf5fce35fc88cf37d714">UNICODE_STRING</a>(cs, -1)</td></tr> <tr class="memdesc:a6cd56429cbf4fe567a97c9d1a46e96ae"><td class="mdescLeft"> </td><td class="mdescRight">Unicode String literals in C++. <a href="#a6cd56429cbf4fe567a97c9d1a46e96ae"></a><br/></td></tr> <tr class="memitem:a486b34c4465b862509e8ed28f01fbe49"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#a486b34c4465b862509e8ed28f01fbe49">UNISTR_FROM_CHAR_EXPLICIT</a></td></tr> <tr class="memdesc:a486b34c4465b862509e8ed28f01fbe49"><td class="mdescLeft"> </td><td class="mdescRight">This can be defined to be empty or "explicit". <a href="#a486b34c4465b862509e8ed28f01fbe49"></a><br/></td></tr> <tr class="memitem:ac4830e8bd24a0774bedb97358e733c1f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#ac4830e8bd24a0774bedb97358e733c1f">UNISTR_FROM_STRING_EXPLICIT</a></td></tr> <tr class="memdesc:ac4830e8bd24a0774bedb97358e733c1f"><td class="mdescLeft"> </td><td class="mdescRight">This can be defined to be empty or "explicit". <a href="#ac4830e8bd24a0774bedb97358e733c1f"></a><br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:aed084b0ce7fd57c71dc5747f03c9879a"><td class="memItemLeft" align="right" valign="top">typedef int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="unistr_8h.html#aed084b0ce7fd57c71dc5747f03c9879a">UStringCaseMapper</a> (const <a class="el" href="ucasemap_8h.html#a2c127e061c4bc5f4ccc9defbe01f9dca">UCaseMap</a> *csm, <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *dest, int32_t destCapacity, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *src, int32_t srcLength, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *pErrorCode)</td></tr> <tr class="memdesc:aed084b0ce7fd57c71dc5747f03c9879a"><td class="mdescLeft"> </td><td class="mdescRight">Internal string case mapping function type. <a href="#aed084b0ce7fd57c71dc5747f03c9879a"></a><br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gac4d8a5581fc5bde71d62ebd0a7a84ec5"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ustring__ustrlen.html#gac4d8a5581fc5bde71d62ebd0a7a84ec5">u_strlen</a> (const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *s)</td></tr> <tr class="memdesc:gac4d8a5581fc5bde71d62ebd0a7a84ec5"><td class="mdescLeft"> </td><td class="mdescRight">Determine the length of an array of UChar. <a href="group__ustring__ustrlen.html#gac4d8a5581fc5bde71d62ebd0a7a84ec5"></a><br/></td></tr> <tr class="memitem:aba07a6dabd3ae5f5ee729f556a9cb960"><td class="memItemLeft" align="right" valign="top"><a class="el" href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a> UnicodeString </td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceicu.html#aba07a6dabd3ae5f5ee729f556a9cb960">icu::operator+</a> (const UnicodeString &s1, const UnicodeString &s2)</td></tr> <tr class="memdesc:aba07a6dabd3ae5f5ee729f556a9cb960"><td class="mdescLeft"> </td><td class="mdescRight">Create a new <a class="el" href="classicu_1_1UnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides similar function...">UnicodeString</a> with the concatenation of two others. <a href="#aba07a6dabd3ae5f5ee729f556a9cb960"></a><br/></td></tr> </table> <a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>C++ API: Unicode String. </p> <p>Definition in file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div><h2>Macro Definition Documentation</h2> <a class="anchor" id="a7fd781b068b28ee2db708090aa32df8f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_COMPARE_CODE_POINT_ORDER   0x8000</td> </tr> </table> </div><div class="memdoc"> <p>Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: Compare strings in code point order instead of code unit order. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001880">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00046">46</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="ae90f6d771de19edc50bf989e607ddf19"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_STRING_CASE_MAPPER_DEFINED</td> </tr> </table> </div><div class="memdoc"> <dl class="internal"><dt><b><a class="el" href="internal.html#_internal000173">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00062">62</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="aeab1ff09f666cf5fce35fc88cf37d714"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define UNICODE_STRING</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname">cs, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"> </td> <td class="paramname">_length </td> </tr> <tr> <td></td> <td>)</td> <td></td><td>   <a class="el" href="classicu_1_1UnicodeString.html">icu::UnicodeString</a>(<a class="el" href="umachine_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>, (const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *)L ## cs, _length)</td> </tr> </table> </div><div class="memdoc"> <p>Unicode String literals in C++. </p> <p>Dependent on the platform properties, different UnicodeString constructors should be used to create a UnicodeString object from a string literal. The macros are defined for maximum performance. They work only for strings that contain "invariant characters", i.e., only latin letters, digits, and some punctuation. See <a class="el" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">utypes.h</a> for details.</p> <p>The string parameter must be a C string literal. The length of the string, not including the terminating <code>NUL</code>, must be specified as a constant. The U_STRING_DECL macro should be invoked exactly once for one such string variable before it is used. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001882">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00117">117</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="a6cd56429cbf4fe567a97c9d1a46e96ae"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define UNICODE_STRING_SIMPLE</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname">cs</td><td>)</td> <td>   <a class="el" href="unistr_8h.html#aeab1ff09f666cf5fce35fc88cf37d714">UNICODE_STRING</a>(cs, -1)</td> </tr> </table> </div><div class="memdoc"> <p>Unicode String literals in C++. </p> <p>Dependent on the platform properties, different UnicodeString constructors should be used to create a UnicodeString object from a string literal. The macros are defined for improved performance. They work only for strings that contain "invariant characters", i.e., only latin letters, digits, and some punctuation. See <a class="el" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">utypes.h</a> for details.</p> <p>The string parameter must be a C string literal. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001883">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00137">137</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="a486b34c4465b862509e8ed28f01fbe49"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define UNISTR_FROM_CHAR_EXPLICIT</td> </tr> </table> </div><div class="memdoc"> <p>This can be defined to be empty or "explicit". </p> <p>If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32) constructors are marked as explicit, preventing their inadvertent use. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001884">Stable:</a></b></dt><dd>ICU 49 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00152">152</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="ac4830e8bd24a0774bedb97358e733c1f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define UNISTR_FROM_STRING_EXPLICIT</td> </tr> </table> </div><div class="memdoc"> <p>This can be defined to be empty or "explicit". </p> <p>If explicit, then the UnicodeString(const char *) and UnicodeString(const UChar *) constructors are marked as explicit, preventing their inadvertent use.</p> <p>In particular, this helps prevent accidentally depending on ICU conversion code by passing a string literal into an API with a const UnicodeString & parameter. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001885">Stable:</a></b></dt><dd>ICU 49 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00172">172</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <a class="anchor" id="a308c066384b8560030fb3482bcb13381"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define US_INV   <a class="el" href="classicu_1_1UnicodeString.html#a301902493406de453a439dfadfdd032fa050455dd0665a3c65d041ae02565f74b">icu::UnicodeString::kInvariant</a></td> </tr> </table> </div><div class="memdoc"> <p>Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a Unicode string from an invariant-character char * string. </p> <p>About invariant characters see <a class="el" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">utypes.h</a>. This constructor has no runtime dependency on conversion code and is therefore recommended over ones taking a charset name string (where the empty string "" indicates invariant-character conversion).</p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable001881">Stable:</a></b></dt><dd>ICU 3.2 </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00095">95</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> <h2>Typedef Documentation</h2> <a class="anchor" id="aed084b0ce7fd57c71dc5747f03c9879a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int32_t UStringCaseMapper(const <a class="el" href="ucasemap_8h.html#a2c127e061c4bc5f4ccc9defbe01f9dca">UCaseMap</a> *csm, <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *dest, int32_t destCapacity, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *src, int32_t srcLength, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *pErrorCode)</td> </tr> </table> </div><div class="memdoc"> <p>Internal string case mapping function type. </p> <dl class="internal"><dt><b><a class="el" href="internal.html#_internal000174">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl> <p>Definition at line <a class="el" href="unistr_8h_source.html#l00069">69</a> of file <a class="el" href="unistr_8h_source.html">unistr.h</a>.</p> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Oct 4 2013 14:10:23 for ICU 52.1 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>