<!-- 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: stsearch.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>stsearch.h</h1><a href="stsearch_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) 2001-2008 IBM and others. All rights reserved.</span> <a name="l00004"></a>00004 <span class="comment">**********************************************************************</span> <a name="l00005"></a>00005 <span class="comment">* Date Name Description</span> <a name="l00006"></a>00006 <span class="comment">* 03/22/2000 helena Creation.</span> <a name="l00007"></a>00007 <span class="comment">**********************************************************************</span> <a name="l00008"></a>00008 <span class="comment">*/</span> <a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#ifndef STSEARCH_H</span> <a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define STSEARCH_H</span> <a name="l00012"></a>00012 <span class="preprocessor"></span> <a name="l00013"></a>00013 <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="l00014"></a>00014 <a name="l00020"></a>00020 <span class="preprocessor">#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="tblcoll_8h.html" title="C++ API: RuleBasedCollator class provides the simple implementation of Collator.">unicode/tblcoll.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="coleitr_8h.html" title="C++ API: Collation Element Iterator.">unicode/coleitr.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="search_8h.html" title="C++ API: SearchIterator object.">unicode/search.h</a>"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <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="l00027"></a>00027 <a name="l00138"></a><a class="code" href="classStringSearch.html">00138</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="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a> : <span class="keyword">public</span> <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</a> <a name="l00139"></a>00139 { <a name="l00140"></a>00140 <span class="keyword">public</span>: <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="comment">// public constructors and destructors --------------------------------</span> <a name="l00143"></a>00143 <a name="l00165"></a>00165 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<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> &pattern, <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> &text, <a name="l00166"></a>00166 <span class="keyword">const</span> <a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a> &locale, <a name="l00167"></a>00167 <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter, <a name="l00168"></a>00168 <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="l00169"></a>00169 <a name="l00191"></a>00191 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<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> &pattern, <a name="l00192"></a>00192 <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> &text, <a name="l00193"></a>00193 <a class="code" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> *coll, <a name="l00194"></a>00194 <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter, <a name="l00195"></a>00195 <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="l00196"></a>00196 <a name="l00222"></a>00222 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<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> &pattern, <a class="code" href="classCharacterIterator.html" title="Abstract class that defines an API for iteration on text objects.">CharacterIterator</a> &text, <a name="l00223"></a>00223 <span class="keyword">const</span> <a class="code" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a> &locale, <a name="l00224"></a>00224 <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter, <a name="l00225"></a>00225 <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="l00226"></a>00226 <a name="l00252"></a>00252 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<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> &pattern, <a class="code" href="classCharacterIterator.html" title="Abstract class that defines an API for iteration on text objects.">CharacterIterator</a> &text, <a name="l00253"></a>00253 <a class="code" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> *coll, <a name="l00254"></a>00254 <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter, <a name="l00255"></a>00255 <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="l00256"></a>00256 <a name="l00263"></a>00263 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<span class="keyword">const</span> <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a> &that); <a name="l00264"></a>00264 <a name="l00270"></a>00270 <span class="keyword">virtual</span> ~<a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(<span class="keywordtype">void</span>); <a name="l00271"></a>00271 <a name="l00283"></a>00283 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a> *clone() <span class="keyword">const</span>; <a name="l00284"></a>00284 <a name="l00285"></a>00285 <span class="comment">// operator overloading ---------------------------------------------</span> <a name="l00286"></a>00286 <a name="l00293"></a>00293 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a> & <a class="code" href="classSearchIterator.html#ada060084cf2fb3ccf7c64cb71488d89e" title="Assignment operator.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a> &that); <a name="l00294"></a>00294 <a name="l00303"></a>00303 <span class="keyword">virtual</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="classSearchIterator.html#ac404a3e74b33dcdabda002c4b9438132" title="Equality operator.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</a> &that) <span class="keyword">const</span>; <a name="l00304"></a>00304 <a name="l00305"></a>00305 <span class="comment">// public get and set methods ----------------------------------------</span> <a name="l00306"></a>00306 <a name="l00320"></a>00320 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSearchIterator.html#a051291e515560612b18fd5c58b2fc523" title="Sets the index to point to the given position, and clears any state that&#39;s affected...">setOffset</a>(int32_t position, <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="l00321"></a>00321 <a name="l00330"></a>00330 <span class="keyword">virtual</span> int32_t <a class="code" href="classSearchIterator.html#a405b15d976003735d48fe1c534a5045d" title="Return the current index in the text being searched.">getOffset</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00331"></a>00331 <a name="l00343"></a>00343 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSearchIterator.html#a14a7f30bf44acdebd78559ec47424d7f" title="Set the string text to be searched.">setText</a>(<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> &text, <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="l00344"></a>00344 <a name="l00359"></a>00359 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSearchIterator.html#a14a7f30bf44acdebd78559ec47424d7f" title="Set the string text to be searched.">setText</a>(<a class="code" href="classCharacterIterator.html" title="Abstract class that defines an API for iteration on text objects.">CharacterIterator</a> &text, <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="l00360"></a>00360 <a name="l00370"></a>00370 <a class="code" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> * getCollator() <span class="keyword">const</span>; <a name="l00371"></a>00371 <a name="l00382"></a>00382 <span class="keywordtype">void</span> setCollator(<a class="code" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> *coll, <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="l00383"></a>00383 <a name="l00393"></a>00393 <span class="keywordtype">void</span> setPattern(<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> &pattern, <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="l00394"></a>00394 <a name="l00400"></a>00400 <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> & getPattern() <span class="keyword">const</span>; <a name="l00401"></a>00401 <a name="l00402"></a>00402 <span class="comment">// public methods ----------------------------------------------------</span> <a name="l00403"></a>00403 <a name="l00412"></a>00412 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSearchIterator.html#ad72b74b2fbe16ca0a449919984e85db9" title="Resets the iteration.">reset</a>(); <a name="l00413"></a>00413 <a name="l00422"></a>00422 <span class="keyword">virtual</span> <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</a> * <a class="code" href="classSearchIterator.html#a7dfe65a9875be67e88151a1987053c6e" title="Returns a copy of SearchIterator with the same behavior, and iterating over the same...">safeClone</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00423"></a>00423 <a name="l00429"></a>00429 <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="l00430"></a>00430 <a name="l00436"></a>00436 <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> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> getStaticClassID(); <a name="l00437"></a>00437 <a name="l00438"></a>00438 <span class="keyword">protected</span>: <a name="l00439"></a>00439 <a name="l00440"></a>00440 <span class="comment">// protected method -------------------------------------------------</span> <a name="l00441"></a>00441 <a name="l00464"></a>00464 <span class="keyword">virtual</span> int32_t <a class="code" href="classSearchIterator.html#a18c8f6a8faec99e860e6ee6e41fa630a" title="Abstract method which subclasses override to provide the mechanism for finding the...">handleNext</a>(int32_t position, <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="l00465"></a>00465 <a name="l00488"></a>00488 <span class="keyword">virtual</span> int32_t <a class="code" href="classSearchIterator.html#afa84ddfd9914bfb6857e8450b5571361" title="Abstract method which subclasses override to provide the mechanism for finding the...">handlePrev</a>(int32_t position, <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="l00489"></a>00489 <a name="l00490"></a>00490 <span class="keyword">private</span> : <a name="l00491"></a>00491 <a class="code" href="classStringSearch.html" title="StringSearch is a SearchIterator that provides language-sensitive text searching...">StringSearch</a>(); <span class="comment">// default constructor not implemented</span> <a name="l00492"></a>00492 <a name="l00493"></a>00493 <span class="comment">// private data members ----------------------------------------------</span> <a name="l00494"></a>00494 <a name="l00499"></a>00499 <a class="code" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> m_collator_; <a name="l00504"></a>00504 <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> m_pattern_; <a name="l00509"></a>00509 <a class="code" href="usearch_8h.html#ab244c09051ecef7e477be6f3e247796d" title="Data structure for searching.">UStringSearch</a> *m_strsrch_; <a name="l00510"></a>00510 <a name="l00511"></a>00511 }; <a name="l00512"></a>00512 <a name="l00513"></a>00513 <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="l00514"></a>00514 <a name="l00515"></a>00515 <span class="preprocessor">#endif </span><span class="comment">/* #if !UCONFIG_NO_COLLATION */</span> <a name="l00516"></a>00516 <a name="l00517"></a>00517 <span class="preprocessor">#endif</span> <a name="l00518"></a>00518 <span class="preprocessor"></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>