<!-- 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.1: colldata.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <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 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="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>colldata.h</h1><a href="colldata_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> ******************************************************************************</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1996-2010, International Business Machines *</span> <a name="l00004"></a>00004 <span class="comment"> * Corporation and others. All Rights Reserved. *</span> <a name="l00005"></a>00005 <span class="comment"> ******************************************************************************</span> <a name="l00006"></a>00006 <span class="comment"> */</span> <a name="l00007"></a>00007 <a name="l00014"></a>00014 <span class="preprocessor">#ifndef COLL_DATA_H</span> <a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define COLL_DATA_H</span> <a name="l00016"></a>00016 <span class="preprocessor"></span> <a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">unicode/utypes.h</a>"</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#if !UCONFIG_NO_COLLATION</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="uobject_8h.html" title="C++ API: Common ICU base class UObject.">unicode/uobject.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="ucol_8h.html" title="C API: Collator.">unicode/ucol.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <a class="code" href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b" title="This is used to begin a declaration of a public ICU C++ API.">U_NAMESPACE_BEGIN</a> <a name="l00025"></a>00025 <a name="l00030"></a><a class="code" href="colldata_8h.html#a14fa824bf994f0e193fdf507563cfc50">00030</a> <span class="preprocessor">#define KEY_BUFFER_SIZE 64</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00036"></a><a class="code" href="colldata_8h.html#a2f4144735e5ee545ac5bba7320048b08">00036</a> <span class="preprocessor">#define CELIST_BUFFER_SIZE 4</span> <a name="l00037"></a>00037 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="comment">//#define INSTRUMENT_CELIST</span> <a name="l00045"></a>00045 <a name="l00050"></a><a class="code" href="colldata_8h.html#abfdbb46f1d99b8e3fc04bc6fb2f5e12b">00050</a> <span class="preprocessor">#define STRING_LIST_BUFFER_SIZE 16</span> <a name="l00051"></a>00051 <span class="preprocessor"></span> <a name="l00058"></a>00058 <span class="comment">//#define INSTRUMENT_STRING_LIST</span> <a name="l00059"></a>00059 <a name="l00066"></a><a class="code" href="classCEList.html">00066</a> <span class="keyword">class </span><a class="code" href="utypes_8h.html#ab9d90a30137b6ec046fe59e79b09745a" title="Set to export library symbols from inside the i18n library, and to import them from...">U_I18N_API</a> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> : <span class="keyword">public</span> <a class="code" href="classUObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class.">UObject</a> <a name="l00067"></a>00067 { <a name="l00068"></a>00068 <span class="keyword">public</span>: <a name="l00082"></a>00082 <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a>(<a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *coll, <span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> &<span class="keywordtype">string</span>, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00083"></a>00083 <a name="l00088"></a>00088 ~<a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a>(); <a name="l00089"></a>00089 <a name="l00097"></a>00097 int32_t size() <span class="keyword">const</span>; <a name="l00098"></a>00098 <a name="l00108"></a>00108 uint32_t <span class="keyword">get</span>(int32_t index) <span class="keyword">const</span>; <a name="l00109"></a>00109 <a name="l00121"></a>00121 <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> matchesAt(int32_t offset, <span class="keyword">const</span> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> *other) <span class="keyword">const</span>; <a name="l00122"></a>00122 <a name="l00132"></a>00132 uint32_t &operator[](int32_t index) <span class="keyword">const</span>; <a name="l00133"></a>00133 <a name="l00138"></a>00138 <span class="keyword">virtual</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262" title="ICU4C &quot;poor man&#39;s RTTI&quot;, returns a UClassID for the actual ICU class...">getDynamicClassID</a>() <span class="keyword">const</span>; <a name="l00143"></a>00143 <span class="keyword">static</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> getStaticClassID(); <a name="l00144"></a>00144 <a name="l00145"></a>00145 <span class="keyword">private</span>: <a name="l00146"></a>00146 <span class="keywordtype">void</span> add(uint32_t ce, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00147"></a>00147 <a name="l00148"></a>00148 uint32_t ceBuffer[<a class="code" href="colldata_8h.html#a2f4144735e5ee545ac5bba7320048b08" title="The size of the internal CE buffer in a CEList object.">CELIST_BUFFER_SIZE</a>]; <a name="l00149"></a>00149 uint32_t *ces; <a name="l00150"></a>00150 int32_t listMax; <a name="l00151"></a>00151 int32_t listSize; <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="preprocessor">#ifdef INSTRUMENT_CELIST</span> <a name="l00154"></a>00154 <span class="preprocessor"></span> <span class="keyword">static</span> int32_t _active; <a name="l00155"></a>00155 <span class="keyword">static</span> int32_t _histogram[10]; <a name="l00156"></a>00156 <span class="preprocessor">#endif</span> <a name="l00157"></a>00157 <span class="preprocessor"></span>}; <a name="l00158"></a>00158 <a name="l00166"></a><a class="code" href="classStringList.html">00166</a> <span class="keyword">class </span><a class="code" href="utypes_8h.html#ab9d90a30137b6ec046fe59e79b09745a" title="Set to export library symbols from inside the i18n library, and to import them from...">U_I18N_API</a> <a class="code" href="classStringList.html" title="StringList.">StringList</a> : <span class="keyword">public</span> <a class="code" href="classUObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class.">UObject</a> <a name="l00167"></a>00167 { <a name="l00168"></a>00168 <span class="keyword">public</span>: <a name="l00180"></a>00180 <a class="code" href="classStringList.html" title="StringList.">StringList</a>(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00181"></a>00181 <a name="l00187"></a>00187 ~<a class="code" href="classStringList.html" title="StringList.">StringList</a>(); <a name="l00188"></a>00188 <a name="l00197"></a>00197 <span class="keywordtype">void</span> add(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> *<span class="keywordtype">string</span>, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00198"></a>00198 <a name="l00208"></a>00208 <span class="keywordtype">void</span> add(<span class="keyword">const</span> <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac" title="Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned...">UChar</a> *chars, int32_t count, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00209"></a>00209 <a name="l00220"></a>00220 <span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> *<span class="keyword">get</span>(int32_t index) <span class="keyword">const</span>; <a name="l00221"></a>00221 <a name="l00229"></a>00229 int32_t size() <span class="keyword">const</span>; <a name="l00230"></a>00230 <a name="l00235"></a>00235 <span class="keyword">virtual</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262" title="ICU4C &quot;poor man&#39;s RTTI&quot;, returns a UClassID for the actual ICU class...">getDynamicClassID</a>() <span class="keyword">const</span>; <a name="l00240"></a>00240 <span class="keyword">static</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> getStaticClassID(); <a name="l00241"></a>00241 <a name="l00242"></a>00242 <span class="keyword">private</span>: <a name="l00243"></a>00243 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> *strings; <a name="l00244"></a>00244 int32_t listMax; <a name="l00245"></a>00245 int32_t listSize; <a name="l00246"></a>00246 <a name="l00247"></a>00247 <span class="preprocessor">#ifdef INSTRUMENT_STRING_LIST</span> <a name="l00248"></a>00248 <span class="preprocessor"></span> <span class="keyword">static</span> int32_t _lists; <a name="l00249"></a>00249 <span class="keyword">static</span> int32_t _strings; <a name="l00250"></a>00250 <span class="keyword">static</span> int32_t _histogram[101]; <a name="l00251"></a>00251 <span class="preprocessor">#endif</span> <a name="l00252"></a>00252 <span class="preprocessor"></span>}; <a name="l00253"></a>00253 <a name="l00254"></a>00254 <span class="comment">/*</span> <a name="l00255"></a>00255 <span class="comment"> * Forward references to internal classes.</span> <a name="l00256"></a>00256 <span class="comment"> */</span> <a name="l00257"></a>00257 <span class="keyword">class </span>StringToCEsMap; <a name="l00258"></a>00258 <span class="keyword">class </span>CEToStringsMap; <a name="l00259"></a>00259 <span class="keyword">class </span>CollDataCache; <a name="l00260"></a>00260 <a name="l00279"></a><a class="code" href="classCollData.html">00279</a> <span class="keyword">class </span><a class="code" href="utypes_8h.html#ab9d90a30137b6ec046fe59e79b09745a" title="Set to export library symbols from inside the i18n library, and to import them from...">U_I18N_API</a> <a class="code" href="classCollData.html" title="CollData.">CollData</a> : <span class="keyword">public</span> <a class="code" href="classUObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class.">UObject</a> <a name="l00280"></a>00280 { <a name="l00281"></a>00281 <span class="keyword">public</span>: <a name="l00297"></a>00297 <span class="keyword">static</span> <a class="code" href="classCollData.html" title="CollData.">CollData</a> *open(<a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *collator, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00298"></a>00298 <a name="l00306"></a>00306 <span class="keyword">static</span> <span class="keywordtype">void</span> close(<a class="code" href="classCollData.html" title="CollData.">CollData</a> *collData); <a name="l00307"></a>00307 <a name="l00314"></a>00314 <a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *getCollator() <span class="keyword">const</span>; <a name="l00315"></a>00315 <a name="l00328"></a>00328 <span class="keyword">const</span> <a class="code" href="classStringList.html" title="StringList.">StringList</a> *getStringList(int32_t ce) <span class="keyword">const</span>; <a name="l00329"></a>00329 <a name="l00341"></a>00341 <span class="keyword">const</span> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> *getCEList(<span class="keyword">const</span> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> *<span class="keywordtype">string</span>) <span class="keyword">const</span>; <a name="l00342"></a>00342 <a name="l00350"></a>00350 <span class="keywordtype">void</span> freeCEList(<span class="keyword">const</span> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> *list); <a name="l00351"></a>00351 <a name="l00363"></a>00363 int32_t minLengthInChars(<span class="keyword">const</span> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> *ces, int32_t offset) <span class="keyword">const</span>; <a name="l00364"></a>00364 <a name="l00365"></a>00365 <a name="l00385"></a>00385 int32_t minLengthInChars(<span class="keyword">const</span> <a class="code" href="classCEList.html" title="This object holds a list of CEs generated from a particular UnicodeString.">CEList</a> *ces, int32_t offset, int32_t *history) <span class="keyword">const</span>; <a name="l00386"></a>00386 <a name="l00391"></a>00391 <span class="keyword">virtual</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262" title="ICU4C &quot;poor man&#39;s RTTI&quot;, returns a UClassID for the actual ICU class...">getDynamicClassID</a>() <span class="keyword">const</span>; <a name="l00396"></a>00396 <span class="keyword">static</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> getStaticClassID(); <a name="l00397"></a>00397 <a name="l00410"></a>00410 <span class="keyword">static</span> <span class="keywordtype">void</span> freeCollDataCache(); <a name="l00411"></a>00411 <a name="l00419"></a>00419 <span class="keyword">static</span> <span class="keywordtype">void</span> flushCollDataCache(); <a name="l00420"></a>00420 <a name="l00421"></a>00421 <span class="keyword">private</span>: <a name="l00422"></a>00422 <span class="keyword">friend</span> <span class="keyword">class </span>CollDataCache; <a name="l00423"></a>00423 <span class="keyword">friend</span> <span class="keyword">class </span>CollDataCacheEntry; <a name="l00424"></a>00424 <a name="l00425"></a>00425 <a class="code" href="classCollData.html" title="CollData.">CollData</a>(<a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *collator, <span class="keywordtype">char</span> *cacheKey, int32_t cachekeyLength, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> &status); <a name="l00426"></a>00426 ~<a class="code" href="classCollData.html" title="CollData.">CollData</a>(); <a name="l00427"></a>00427 <a name="l00428"></a>00428 <a class="code" href="classCollData.html" title="CollData.">CollData</a>(); <a name="l00429"></a>00429 <a name="l00430"></a>00430 <span class="keyword">static</span> <span class="keywordtype">char</span> *getCollatorKey(<a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *collator, <span class="keywordtype">char</span> *buffer, int32_t bufferLength); <a name="l00431"></a>00431 <a name="l00432"></a>00432 <span class="keyword">static</span> CollDataCache *getCollDataCache(); <a name="l00433"></a>00433 <a name="l00434"></a>00434 <a class="code" href="ucol_8h.html#a3c4eeb412a5fd72762e6245aa75ca081" title="structure representing a collator object instance">UCollator</a> *coll; <a name="l00435"></a>00435 StringToCEsMap *charsToCEList; <a name="l00436"></a>00436 CEToStringsMap *ceToCharsStartingWith; <a name="l00437"></a>00437 <a name="l00438"></a>00438 <span class="keywordtype">char</span> keyBuffer[<a class="code" href="colldata_8h.html#a14fa824bf994f0e193fdf507563cfc50" title="The size of the internal buffer for the Collator&#39;s short description string.">KEY_BUFFER_SIZE</a>]; <a name="l00439"></a>00439 <span class="keywordtype">char</span> *key; <a name="l00440"></a>00440 <a name="l00441"></a>00441 <span class="keyword">static</span> CollDataCache *collDataCache; <a name="l00442"></a>00442 <a name="l00443"></a>00443 uint32_t minHan; <a name="l00444"></a>00444 uint32_t maxHan; <a name="l00445"></a>00445 <a name="l00446"></a>00446 uint32_t jamoLimits[4]; <a name="l00447"></a>00447 }; <a name="l00448"></a>00448 <a name="l00449"></a>00449 <a class="code" href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933" title="This is used to end a declaration of a public ICU C++ API.">U_NAMESPACE_END</a> <a name="l00450"></a>00450 <a name="l00451"></a>00451 <span class="preprocessor">#endif // #if !UCONFIG_NO_COLLATION</span> <a name="l00452"></a>00452 <span class="preprocessor"></span><span class="preprocessor">#endif // #ifndef COLL_DATA_H</span> </pre></div></div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </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 class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>