<!-- 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: search.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.1 --> <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>search.h</h1><a href="search_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 SEARCH_H</span> <a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define SEARCH_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="uobject_8h.html" title="C++ API: Common ICU base class UObject.">unicode/uobject.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="unistr_8h.html" title="C++ API: Unicode String.">unicode/unistr.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="chariter_8h.html" title="C++ API: Character Iterator.">unicode/chariter.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="brkiter_8h.html" title="C++ API: Break Iterator.">unicode/brkiter.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="usearch_8h.html" title="C API: StringSearch.">unicode/usearch.h</a>"</span> <a name="l00027"></a>00027 <a name="l00031"></a>00031 <span class="keyword">struct </span><a class="code" href="search_8h.html#ab9a54441959795454ae0406609767131">USearch</a>; <a name="l00035"></a><a class="code" href="search_8h.html#ab9a54441959795454ae0406609767131">00035</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="search_8h.html#ab9a54441959795454ae0406609767131">USearch</a> <a class="code" href="search_8h.html#ab9a54441959795454ae0406609767131">USearch</a>; <a name="l00036"></a>00036 <a name="l00037"></a>00037 <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="l00038"></a>00038 <a name="l00079"></a><a class="code" href="classSearchIterator.html">00079</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="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</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="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keyword">public</span>: <a name="l00082"></a>00082 <a name="l00083"></a>00083 <span class="comment">// public constructors and destructors -------------------------------</span> <a name="l00084"></a>00084 <a name="l00091"></a>00091 <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</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> &other); <a name="l00092"></a>00092 <a name="l00097"></a>00097 <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 name="l00098"></a>00098 <a name="l00099"></a>00099 <span class="comment">// public get and set methods ----------------------------------------</span> <a name="l00100"></a>00100 <a name="l00114"></a>00114 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setOffset(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) = 0; <a name="l00115"></a>00115 <a name="l00124"></a>00124 <span class="keyword">virtual</span> int32_t getOffset(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; <a name="l00125"></a>00125 <a name="l00135"></a>00135 <span class="keywordtype">void</span> setAttribute(<a class="code" href="usearch_8h.html#aa382f146f1968a9d1dc182100b23ac03">USearchAttribute</a> attribute, <a name="l00136"></a>00136 <a class="code" href="usearch_8h.html#afbe777746540a229c0a2ff3323e292d1">USearchAttributeValue</a> value, <a name="l00137"></a>00137 <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="l00138"></a>00138 <a name="l00145"></a>00145 <a class="code" href="usearch_8h.html#afbe777746540a229c0a2ff3323e292d1">USearchAttributeValue</a> getAttribute(<a class="code" href="usearch_8h.html#aa382f146f1968a9d1dc182100b23ac03">USearchAttribute</a> attribute) <span class="keyword">const</span>; <a name="l00146"></a>00146 <a name="l00163"></a>00163 int32_t getMatchedStart(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00164"></a>00164 <a name="l00179"></a>00179 int32_t getMatchedLength(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00180"></a>00180 <a name="l00195"></a>00195 <span class="keywordtype">void</span> getMatchedText(<a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> &result) <span class="keyword">const</span>; <a name="l00196"></a>00196 <a name="l00212"></a>00212 <span class="keywordtype">void</span> setBreakIterator(<a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter, <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="l00213"></a>00213 <a name="l00224"></a>00224 <span class="keyword">const</span> <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> * getBreakIterator(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00225"></a>00225 <a name="l00236"></a>00236 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setText(<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="l00237"></a>00237 <a name="l00253"></a>00253 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setText(<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="l00254"></a>00254 <a name="l00260"></a>00260 <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> & getText(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="comment">// operator overloading ----------------------------------------------</span> <a name="l00263"></a>00263 <a name="l00272"></a>00272 <span class="keyword">virtual</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="stringpiece_8h.html#a7652049cbac0bfeae2cd2aa4514a3352" title="Global operator == for StringPiece.">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="l00273"></a>00273 <a name="l00280"></a>00280 <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="stringpiece_8h.html#abf0ccab9536bab551afc07de65eb5d95" title="Global operator != for StringPiece.">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="l00281"></a>00281 <a name="l00282"></a>00282 <span class="comment">// public methods ----------------------------------------------------</span> <a name="l00283"></a>00283 <a name="l00291"></a>00291 <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>* safeClone(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; <a name="l00292"></a>00292 <a name="l00306"></a>00306 int32_t first(<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="l00307"></a>00307 <a name="l00325"></a>00325 int32_t following(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="l00326"></a>00326 <a name="l00340"></a>00340 int32_t last(<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="l00341"></a>00341 <a name="l00359"></a>00359 int32_t preceding(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="l00360"></a>00360 <a name="l00375"></a>00375 int32_t next(<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="l00376"></a>00376 <a name="l00390"></a>00390 int32_t previous(<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="l00391"></a>00391 <a name="l00400"></a>00400 <span class="keyword">virtual</span> <span class="keywordtype">void</span> reset(); <a name="l00401"></a>00401 <a name="l00402"></a>00402 <span class="keyword">protected</span>: <a name="l00403"></a>00403 <span class="comment">// protected data members ---------------------------------------------</span> <a name="l00404"></a>00404 <a name="l00409"></a><a class="code" href="classSearchIterator.html#a37a71b3da6253680b3e24a3e0c3687a5">00409</a> <a class="code" href="search_8h.html#ab9a54441959795454ae0406609767131">USearch</a> *m_search_; <a name="l00410"></a>00410 <a name="l00419"></a><a class="code" href="classSearchIterator.html#a2fa2bb916a411a0df41f4f99e8e74419">00419</a> <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *m_breakiterator_; <a name="l00420"></a>00420 <a name="l00425"></a><a class="code" href="classSearchIterator.html#ada31ca7238c22c2d69fd5192fe036d3d">00425</a> <a class="code" href="classUnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides...">UnicodeString</a> m_text_; <a name="l00426"></a>00426 <a name="l00427"></a>00427 <span class="comment">// protected constructors and destructors -----------------------------</span> <a name="l00428"></a>00428 <a name="l00434"></a>00434 <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="l00435"></a>00435 <a name="l00451"></a>00451 <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</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 name="l00452"></a>00452 <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter = <a class="code" href="utypes_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4" title="Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.">NULL</a>); <a name="l00453"></a>00453 <a name="l00473"></a>00473 <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="classCharacterIterator.html" title="Abstract class that defines an API for iteration on text objects.">CharacterIterator</a> &text, <a class="code" href="classBreakIterator.html" title="The BreakIterator class implements methods for finding the location of boundaries...">BreakIterator</a> *breakiter = <a class="code" href="utypes_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4" title="Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.">NULL</a>); <a name="l00474"></a>00474 <a name="l00475"></a>00475 <span class="comment">// protected methods --------------------------------------------------</span> <a name="l00476"></a>00476 <a name="l00483"></a>00483 <a class="code" href="classSearchIterator.html" title="SearchIterator is an abstract base class that provides methods to search for a pattern...">SearchIterator</a> & operator=(<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); <a name="l00484"></a>00484 <a name="l00504"></a>00504 <span class="keyword">virtual</span> int32_t handleNext(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="l00505"></a>00505 = 0; <a name="l00506"></a>00506 <a name="l00526"></a>00526 <span class="keyword">virtual</span> int32_t handlePrev(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="l00527"></a>00527 = 0; <a name="l00528"></a>00528 <a name="l00539"></a>00539 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setMatchLength(int32_t length); <a name="l00540"></a>00540 <a name="l00551"></a>00551 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setMatchStart(int32_t position); <a name="l00552"></a>00552 <a name="l00557"></a>00557 <span class="keywordtype">void</span> setMatchNotFound(); <a name="l00558"></a>00558 }; <a name="l00559"></a>00559 <a name="l00560"></a><a class="code" href="classSearchIterator.html#a9fd5b7677b8169e5e5102e621aae31cc">00560</a> <span class="keyword">inline</span> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="classSearchIterator.html#a9fd5b7677b8169e5e5102e621aae31cc" title="Not-equal operator.">SearchIterator::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="l00561"></a>00561 <span class="keyword"></span>{ <a name="l00562"></a>00562 <span class="keywordflow">return</span> !<a class="code" href="classSearchIterator.html#ac404a3e74b33dcdabda002c4b9438132" title="Equality operator.">operator==</a>(that); <a name="l00563"></a>00563 } <a name="l00564"></a>00564 <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="l00565"></a>00565 <a name="l00566"></a>00566 <span class="preprocessor">#endif </span><span class="comment">/* #if !UCONFIG_NO_COLLATION */</span> <a name="l00567"></a>00567 <a name="l00568"></a>00568 <span class="preprocessor">#endif</span> <a name="l00569"></a>00569 <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 size="1"/><address style="text-align: right;"><small>Generated on 16 Mar 2010 for ICU 4.4 by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>