Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 34ae14235711d1471f043ac894a061f9 > files > 135

libicu-doc-3.6-5.16.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ICU 3.6: StringSearch Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li id="current"><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
  </ul></div>
<h1>StringSearch Class Reference</h1><!-- doxytag: class="StringSearch" --><!-- doxytag: inherits="SearchIterator" --><code><a class="el" href="classStringSearch.html">StringSearch</a></code> is a <code><a class="el" href="classSearchIterator.html">SearchIterator</a></code> that provides language-sensitive text searching based on the comparison rules defined in a <a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> object.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="stsearch_8h-source.html">stsearch.h</a>&gt;</code>
<p>
<p>Inheritance diagram for StringSearch:
<p><center><img src="classStringSearch.png" usemap="#StringSearch_map" border="0" alt=""></center>
<map name="StringSearch_map">
<area href="classSearchIterator.html" alt="SearchIterator" shape="rect" coords="0,112,93,136">
<area href="classUObject.html" alt="UObject" shape="rect" coords="0,56,93,80">
<area href="classUMemory.html" alt="UMemory" shape="rect" coords="0,0,93,24">
</map>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#2c765b20dc1f98bde051aeba20aa3967">StringSearch</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;text, const <a class="el" href="classLocale.html">Locale</a> &amp;locale, <a class="el" href="classBreakIterator.html">BreakIterator</a> *breakiter, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument locale language rule set.  <a href="#2c765b20dc1f98bde051aeba20aa3967"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#0398d379c31cbd0cce500b0c421809aa">StringSearch</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;text, <a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *coll, <a class="el" href="classBreakIterator.html">BreakIterator</a> *breakiter, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument collator language rule set.  <a href="#0398d379c31cbd0cce500b0c421809aa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#bf3ea2b43bc1f1c298b7900618c6997f">StringSearch</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, <a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;text, const <a class="el" href="classLocale.html">Locale</a> &amp;locale, <a class="el" href="classBreakIterator.html">BreakIterator</a> *breakiter, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument locale language rule set.  <a href="#bf3ea2b43bc1f1c298b7900618c6997f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#8668367192e9a6fa44ee9b4657183bd3">StringSearch</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, <a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;text, <a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *coll, <a class="el" href="classBreakIterator.html">BreakIterator</a> *breakiter, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument collator language rule set.  <a href="#8668367192e9a6fa44ee9b4657183bd3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#17e9aeec70491b06196b76738e831873">StringSearch</a> (const <a class="el" href="classStringSearch.html">StringSearch</a> &amp;that)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor that creates a <a class="el" href="classStringSearch.html">StringSearch</a> instance with the same behavior, and iterating over the same text.  <a href="#17e9aeec70491b06196b76738e831873"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#b27151f27574a5a30e83c224adb23a94">~StringSearch</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#b27151f27574a5a30e83c224adb23a94"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classStringSearch.html">StringSearch</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#b0615268133ae9ab5edc2f9528892c11">clone</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clone this object.  <a href="#b0615268133ae9ab5edc2f9528892c11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classStringSearch.html">StringSearch</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#75065d302b18e58e89d80a85dbeeddc6">operator=</a> (const <a class="el" href="classStringSearch.html">StringSearch</a> &amp;that)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment operator.  <a href="#75065d302b18e58e89d80a85dbeeddc6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="umachine_8h.html#d373ce262c37cc047b0df2ad7b5dbba7">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#4d63b916613ccb32fe8defed34339017">operator==</a> (const <a class="el" href="classSearchIterator.html">SearchIterator</a> &amp;that) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Equality operator.  <a href="#4d63b916613ccb32fe8defed34339017"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#eb51073c3cb7ff0cd206ccdacd1daa96">setOffset</a> (<a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> position, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the index to point to the given position, and clears any state that's affected.  <a href="#eb51073c3cb7ff0cd206ccdacd1daa96"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#3f1ceba14e61964bde642410c821773a">getOffset</a> (void) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the current index in the text being searched.  <a href="#3f1ceba14e61964bde642410c821773a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#93b9fcdedbf91ffa55c25defc767d8e6">setText</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;text, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the target text to be searched.  <a href="#93b9fcdedbf91ffa55c25defc767d8e6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#68c55e8eafb76362cb047945a8938e21">setText</a> (<a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;text, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the target text to be searched.  <a href="#68c55e8eafb76362cb047945a8938e21"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#91b5803d6003ee392a933426a63f3921">getCollator</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the collator used for the language rules.  <a href="#91b5803d6003ee392a933426a63f3921"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#a21f0da2d58e929d4f0f4d771708f558">setCollator</a> (<a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *coll, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the collator used for the language rules.  <a href="#a21f0da2d58e929d4f0f4d771708f558"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#17616ece77021ca3311d5391421ee190">setPattern</a> (const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;pattern, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the pattern used for matching.  <a href="#17616ece77021ca3311d5391421ee190"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#08a478b0fc37827fd672b1c06e6a3946">getPattern</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the search pattern.  <a href="#08a478b0fc37827fd672b1c06e6a3946"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#99e8e6047d1275f16a8b683a0715c0bf">reset</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reset the iteration.  <a href="#99e8e6047d1275f16a8b683a0715c0bf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classSearchIterator.html">SearchIterator</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#fb80c6e845fdf495a414649fed7f605d">safeClone</a> (void) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a copy of <a class="el" href="classStringSearch.html">StringSearch</a> with the same behavior, and iterating over the same text, as this one.  <a href="#fb80c6e845fdf495a414649fed7f605d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="utypes_8h.html#452dc3c7d14eb1a1837ae1aa0b2d6724">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#de14a0bdf1099de3d3a1702806a7e661">getDynamicClassID</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for the actual class.  <a href="#de14a0bdf1099de3d3a1702806a7e661"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="utypes_8h.html#452dc3c7d14eb1a1837ae1aa0b2d6724">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#43851a6e1a4b88835096c00bcff2e244">getStaticClassID</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for this class.  <a href="#43851a6e1a4b88835096c00bcff2e244"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#88c70bc820ded17136439573c171dea9">handleNext</a> (<a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> position, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Search forward for matching text, starting at a given location.  <a href="#88c70bc820ded17136439573c171dea9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStringSearch.html#504d4d0f347c7251eb3e79bab1163038">handlePrev</a> (<a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> position, <a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Search backward for matching text, starting at a given location.  <a href="#504d4d0f347c7251eb3e79bab1163038"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<code><a class="el" href="classStringSearch.html">StringSearch</a></code> is a <code><a class="el" href="classSearchIterator.html">SearchIterator</a></code> that provides language-sensitive text searching based on the comparison rules defined in a <a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> object. 
<p>
<a class="el" href="classStringSearch.html">StringSearch</a> ensures that language eccentricity can be handled, e.g. for the German collator, characters &szlig; and SS will be matched if case is chosen to be ignored. See the <a href="http://dev.icu-project.org/cgi-bin/viewcvs.cgi/~checkout~/icuhtml/design/collation/ICU_collation_design.htm">"ICU Collation Design Document"</a> for more information. <p>
The algorithm implemented is a modified form of the Boyer Moore's search. For more information see <a href="http://icu.sourceforge.net/docs/papers/efficient_text_searching_in_java.html">"Efficient Text Searching in Java"</a>, published in <em>Java Report</em> in February, 1999, for further information on the algorithm. <p>
There are 2 match options for selection:<br>
 Let S' be the sub-string of a text string S between the offsets start and end &lt;start, end&gt;. <br>
 A pattern string P matches a text string S at the offsets &lt;start, end&gt; if <pre> 
 option 1. Some canonical equivalent of P matches some canonical equivalent 
           of S'
 option 2. P matches S' and if P starts or ends with a combining mark, 
           there exists no non-ignorable combining mark before or after S? 
           in S respectively. 
 </pre> Option 2. will be the default. <p>
This search has APIs similar to that of other text iteration mechanisms such as the break iterators in <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code>. Using these APIs, it is easy to scan through text looking for all occurances of a given pattern. This search iterator allows changing of direction by calling a <code>reset</code> followed by a <code>next</code> or <code>previous</code>. Though a direction change can occur without calling <code>reset</code> first, this operation comes with some speed penalty. Match results in the forward direction will match the result matches in the backwards direction in the reverse order <p>
<code><a class="el" href="classSearchIterator.html">SearchIterator</a></code> provides APIs to specify the starting position within the text string to be searched, e.g. <code>setOffset</code>, <code>preceding</code> and <code>following</code>. Since the starting position will be set as it is specified, please take note that there are some danger points which the search may render incorrect results: <ul>
<li>
The midst of a substring that requires normalization. </li>
<li>
If the following match is to be found, the position should not be the second character which requires to be swapped with the preceding character. Vice versa, if the preceding match is to be found, position to search from should not be the first character which requires to be swapped with the next character. E.g certain Thai and Lao characters require swapping. </li>
<li>
If a following pattern match is to be found, any position within a contracting sequence except the first will fail. Vice versa if a preceding pattern match is to be found, a invalid starting point would be any character within a contracting sequence except the last. </li>
</ul>
<p>
A breakiterator can be used if only matches at logical breaks are desired. Using a breakiterator will only give you results that exactly matches the boundaries given by the breakiterator. For instance the pattern "e" will not be found in the string "\u00e9" if a character break iterator is used. <p>
Options are provided to handle overlapping matches. E.g. In English, overlapping matches produces the result 0 and 2 for the pattern "abab" in the text "ababab", where else mutually exclusive matches only produce the result of 0. <p>
Though collator attributes will be taken into consideration while performing matches, there are no APIs here for setting and getting the attributes. These attributes can be set by getting the collator from <code>getCollator</code> and using the APIs in <code><a class="el" href="coll_8h.html">coll.h</a></code>. Lastly to update <a class="el" href="classStringSearch.html">StringSearch</a> to the new collator attributes, <a class="el" href="classStringSearch.html#99e8e6047d1275f16a8b683a0715c0bf">reset()</a> has to be called. <p>
Restriction: <br>
 Currently there are no composite characters that consists of a character with combining class &gt; 0 before a character with combining class == 0. However, if such a character exists in the future, <a class="el" href="classStringSearch.html">StringSearch</a> does not guarantee the results for option 1. <p>
Consult the <code><a class="el" href="classSearchIterator.html">SearchIterator</a></code> documentation for information on and examples of how to use instances of this class to implement text searching. <pre><code>
 <a class="el" href="classUnicodeString.html">UnicodeString</a> target("The quick brown fox jumped over the lazy fox");
 <a class="el" href="classUnicodeString.html">UnicodeString</a> pattern("fox");</code></pre><p>
<pre><code> <a class="el" href="classSearchIterator.html">SearchIterator</a> *iter  = new StringSearch(pattern, target);
 UErrorCode      error = U_ZERO_ERROR;
 for (int pos = iter-&gt;first(error); pos != USEARCH_DONE; 
                               pos = iter-&gt;next(error)) {
     printf("Found match at %d pos, length is %d\n", pos, 
                                             iter.getMatchLength());
 }
 </code></pre> <p>
Note, <a class="el" href="classStringSearch.html">StringSearch</a> is not to be subclassed.  <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classSearchIterator.html">SearchIterator</a> <p>
<a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> </dd></dl>
<dl compact><dt><b>Since:</b></dt><dd>ICU 2.0 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="stsearch_8h-source.html#l00136">136</a> of file <a class="el" href="stsearch_8h-source.html">stsearch.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="2c765b20dc1f98bde051aeba20aa3967"></a><!-- doxytag: member="StringSearch::StringSearch" ref="2c765b20dc1f98bde051aeba20aa3967" args="(const UnicodeString &amp;pattern, const UnicodeString &amp;text, const Locale &amp;locale, BreakIterator *breakiter, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StringSearch::StringSearch           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classLocale.html">Locale</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>locale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classBreakIterator.html">BreakIterator</a> *&nbsp;</td>
          <td class="paramname"> <em>breakiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument locale language rule set. 
<p>
A collator will be created in the process, which will be owned by this instance and will be deleted during destruction <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>The text for which this object will search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The text in which to search for the pattern. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>locale</em>&nbsp;</td><td>A locale which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>breakiter</em>&nbsp;</td><td>A <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> are ignored. If this behavior is not desired, <code>NULL</code> can be passed in instead. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If pattern or text is NULL, or if either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002560">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="0398d379c31cbd0cce500b0c421809aa"></a><!-- doxytag: member="StringSearch::StringSearch" ref="0398d379c31cbd0cce500b0c421809aa" args="(const UnicodeString &amp;pattern, const UnicodeString &amp;text, RuleBasedCollator *coll, BreakIterator *breakiter, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StringSearch::StringSearch           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *&nbsp;</td>
          <td class="paramname"> <em>coll</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classBreakIterator.html">BreakIterator</a> *&nbsp;</td>
          <td class="paramname"> <em>breakiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument collator language rule set. 
<p>
Note, user retains the ownership of this collator, it does not get destroyed during this instance's destruction. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>The text for which this object will search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The text in which to search for the pattern. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>coll</em>&nbsp;</td><td>A <code><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a></code> object which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>breakiter</em>&nbsp;</td><td>A <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> are ignored. If this behavior is not desired, <code>NULL</code> can be passed in instead. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002561">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="bf3ea2b43bc1f1c298b7900618c6997f"></a><!-- doxytag: member="StringSearch::StringSearch" ref="bf3ea2b43bc1f1c298b7900618c6997f" args="(const UnicodeString &amp;pattern, CharacterIterator &amp;text, const Locale &amp;locale, BreakIterator *breakiter, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StringSearch::StringSearch           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classLocale.html">Locale</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>locale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classBreakIterator.html">BreakIterator</a> *&nbsp;</td>
          <td class="paramname"> <em>breakiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument locale language rule set. 
<p>
A collator will be created in the process, which will be owned by this instance and will be deleted during destruction <p>
Note: No parsing of the text within the <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be done during searching for this version. The block of text in <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be used as it is. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>The text for which this object will search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The text iterator in which to search for the pattern. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>locale</em>&nbsp;</td><td>A locale which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>breakiter</em>&nbsp;</td><td>A <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> are ignored. If this behavior is not desired, <code>NULL</code> can be passed in instead. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002562">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="8668367192e9a6fa44ee9b4657183bd3"></a><!-- doxytag: member="StringSearch::StringSearch" ref="8668367192e9a6fa44ee9b4657183bd3" args="(const UnicodeString &amp;pattern, CharacterIterator &amp;text, RuleBasedCollator *coll, BreakIterator *breakiter, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StringSearch::StringSearch           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *&nbsp;</td>
          <td class="paramname"> <em>coll</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classBreakIterator.html">BreakIterator</a> *&nbsp;</td>
          <td class="paramname"> <em>breakiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creating a <code><a class="el" href="classStringSearch.html">StringSearch</a></code> instance using the argument collator language rule set. 
<p>
Note, user retains the ownership of this collator, it does not get destroyed during this instance's destruction. <p>
Note: No parsing of the text within the <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be done during searching for this version. The block of text in <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be used as it is. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>The text for which this object will search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The text in which to search for the pattern. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>coll</em>&nbsp;</td><td>A <code><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a></code> object which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>breakiter</em>&nbsp;</td><td>A <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the <code><a class="el" href="classBreakIterator.html">BreakIterator</a></code> are ignored. If this behavior is not desired, <code>NULL</code> can be passed in instead. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002563">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="17e9aeec70491b06196b76738e831873"></a><!-- doxytag: member="StringSearch::StringSearch" ref="17e9aeec70491b06196b76738e831873" args="(const StringSearch &amp;that)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StringSearch::StringSearch           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classStringSearch.html">StringSearch</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>that</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Copy constructor that creates a <a class="el" href="classStringSearch.html">StringSearch</a> instance with the same behavior, and iterating over the same text. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>that</em>&nbsp;</td><td><a class="el" href="classStringSearch.html">StringSearch</a> instance to be copied. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002564">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="b27151f27574a5a30e83c224adb23a94"></a><!-- doxytag: member="StringSearch::~StringSearch" ref="b27151f27574a5a30e83c224adb23a94" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual StringSearch::~StringSearch           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>
Cleans up the search iterator data struct. If a collator is created in the constructor, it will be destroyed here. <dl compact><dt><b><a class="el" href="stable.html#_stable002565">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="b0615268133ae9ab5edc2f9528892c11"></a><!-- doxytag: member="StringSearch::clone" ref="b0615268133ae9ab5edc2f9528892c11" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classStringSearch.html">StringSearch</a>* StringSearch::clone           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Clone this object. 
<p>
Clones can be used concurrently in multiple threads. If an error occurs, then NULL is returned. The caller must delete the clone.<p>
<dl compact><dt><b>Returns:</b></dt><dd>a clone of this object</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classStringSearch.html#de14a0bdf1099de3d3a1702806a7e661">getDynamicClassID</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002566">Stable:</a></b></dt><dd>ICU 2.8 </dd></dl>

</div>
</div><p>
<a class="anchor" name="91b5803d6003ee392a933426a63f3921"></a><!-- doxytag: member="StringSearch::getCollator" ref="91b5803d6003ee392a933426a63f3921" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a>* StringSearch::getCollator           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gets the collator used for the language rules. 
<p>
Caller may modify but <b>must not</b> delete the <code><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a></code>! Modifications to this collator will affect the original collator passed in to the <code><a class="el" href="classStringSearch.html">StringSearch</a>&gt;</code> constructor or to setCollator, if any. <dl compact><dt><b>Returns:</b></dt><dd>collator used for string search </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002573">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="de14a0bdf1099de3d3a1702806a7e661"></a><!-- doxytag: member="StringSearch::getDynamicClassID" ref="de14a0bdf1099de3d3a1702806a7e661" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="utypes_8h.html#452dc3c7d14eb1a1837ae1aa0b2d6724">UClassID</a> StringSearch::getDynamicClassID           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
ICU "poor man's RTTI", returns a UClassID for the actual class. 
<p>
<dl compact><dt><b><a class="el" href="stable.html#_stable002579">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl>

<p>
Implements <a class="el" href="classUObject.html#60f3fba82b9d7edfe3d3f9d423ab826d">UObject</a>.
</div>
</div><p>
<a class="anchor" name="3f1ceba14e61964bde642410c821773a"></a><!-- doxytag: member="StringSearch::getOffset" ref="3f1ceba14e61964bde642410c821773a" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> StringSearch::getOffset           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the current index in the text being searched. 
<p>
If the iteration has gone past the end of the text (or past the beginning for a backwards search), USEARCH_DONE is returned. <dl compact><dt><b>Returns:</b></dt><dd>current index in the text being searched. </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002570">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Implements <a class="el" href="classSearchIterator.html#d7bbd54897648832cf02e2f8da1d61d9">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="08a478b0fc37827fd672b1c06e6a3946"></a><!-- doxytag: member="StringSearch::getPattern" ref="08a478b0fc37827fd672b1c06e6a3946" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classUnicodeString.html">UnicodeString</a>&amp; StringSearch::getPattern           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gets the search pattern. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>pattern used for matching </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002576">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="43851a6e1a4b88835096c00bcff2e244"></a><!-- doxytag: member="StringSearch::getStaticClassID" ref="43851a6e1a4b88835096c00bcff2e244" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="utypes_8h.html#452dc3c7d14eb1a1837ae1aa0b2d6724">UClassID</a> StringSearch::getStaticClassID           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
ICU "poor man's RTTI", returns a UClassID for this class. 
<p>
<dl compact><dt><b><a class="el" href="stable.html#_stable002580">Stable:</a></b></dt><dd>ICU 2.2 </dd></dl>

</div>
</div><p>
<a class="anchor" name="88c70bc820ded17136439573c171dea9"></a><!-- doxytag: member="StringSearch::handleNext" ref="88c70bc820ded17136439573c171dea9" args="(int32_t position, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> StringSearch::handleNext           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td>
          <td class="paramname"> <em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Search forward for matching text, starting at a given location. 
<p>
Clients should not call this method directly; instead they should call <a class="el" href="classSearchIterator.html#f8a95f80d007b0513ab5b17afa572904">SearchIterator#next</a>. <p>
If a match is found, this method returns the index at which the match starts and calls <a class="el" href="classSearchIterator.html#1c8198dae857f41444d1c4d65fc35a62">SearchIterator#setMatchLength</a> with the number of characters in the target text that make up the match. If no match is found, the method returns <code>USEARCH_DONE</code>. <p>
The <code><a class="el" href="classStringSearch.html">StringSearch</a></code> is adjusted so that its current index (as returned by <a class="el" href="classStringSearch.html#3f1ceba14e61964bde642410c821773a">getOffset</a>) is the match position if one was found. If a match is not found, <code>USEARCH_DONE</code> will be returned and the <code><a class="el" href="classStringSearch.html">StringSearch</a></code> will be adjusted to the index USEARCH_DONE. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>position</em>&nbsp;</td><td>The index in the target text at which the search starts </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any occurs </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The index at which the matched text in the target starts, or USEARCH_DONE if no match was found. </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002581">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Implements <a class="el" href="classSearchIterator.html#079412fe4ffbbfc36a7edd99e1777e96">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="504d4d0f347c7251eb3e79bab1163038"></a><!-- doxytag: member="StringSearch::handlePrev" ref="504d4d0f347c7251eb3e79bab1163038" args="(int32_t position, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> StringSearch::handlePrev           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td>
          <td class="paramname"> <em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Search backward for matching text, starting at a given location. 
<p>
Clients should not call this method directly; instead they should call <code><a class="el" href="classSearchIterator.html#7a5f157c0d78b280f0c9ab734c4d24fc">SearchIterator.previous()</a></code>, which this method overrides. <p>
If a match is found, this method returns the index at which the match starts and calls <a class="el" href="classSearchIterator.html#1c8198dae857f41444d1c4d65fc35a62">SearchIterator#setMatchLength</a> with the number of characters in the target text that make up the match. If no match is found, the method returns <code>USEARCH_DONE</code>. <p>
The <code><a class="el" href="classStringSearch.html">StringSearch</a></code> is adjusted so that its current index (as returned by <a class="el" href="classStringSearch.html#3f1ceba14e61964bde642410c821773a">getOffset</a>) is the match position if one was found. If a match is not found, <code>USEARCH_DONE</code> will be returned and the <code><a class="el" href="classStringSearch.html">StringSearch</a></code> will be adjusted to the index USEARCH_DONE. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>position</em>&nbsp;</td><td>The index in the target text at which the search starts. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any occurs </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The index at which the matched text in the target starts, or USEARCH_DONE if no match was found. </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002582">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Implements <a class="el" href="classSearchIterator.html#5a3c660838d34ae97b823c06511f09e0">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="75065d302b18e58e89d80a85dbeeddc6"></a><!-- doxytag: member="StringSearch::operator=" ref="75065d302b18e58e89d80a85dbeeddc6" args="(const StringSearch &amp;that)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classStringSearch.html">StringSearch</a>&amp; StringSearch::operator=           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classStringSearch.html">StringSearch</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>that</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Assignment operator. 
<p>
Sets this iterator to have the same behavior, and iterate over the same text, as the one passed in. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>that</em>&nbsp;</td><td>instance to be copied. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002567">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="4d63b916613ccb32fe8defed34339017"></a><!-- doxytag: member="StringSearch::operator==" ref="4d63b916613ccb32fe8defed34339017" args="(const SearchIterator &amp;that) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="umachine_8h.html#d373ce262c37cc047b0df2ad7b5dbba7">UBool</a> StringSearch::operator==           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSearchIterator.html">SearchIterator</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>that</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Equality operator. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>that</em>&nbsp;</td><td>instance to be compared. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE if both instances have the same attributes, breakiterators, collators and iterate over the same text while looking for the same pattern. </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002568">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Reimplemented from <a class="el" href="classSearchIterator.html#03026bef0e2776a9e49d8828e2d266c1">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="99e8e6047d1275f16a8b683a0715c0bf"></a><!-- doxytag: member="StringSearch::reset" ref="99e8e6047d1275f16a8b683a0715c0bf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void StringSearch::reset           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Reset the iteration. 
<p>
Search will begin at the start of the text string if a forward iteration is initiated before a backwards iteration. Otherwise if a backwards iteration is initiated before a forwards iteration, the search will begin at the end of the text string. <dl compact><dt><b><a class="el" href="stable.html#_stable002577">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Reimplemented from <a class="el" href="classSearchIterator.html#7c7d95af1d47425c64cfbb1d060c7657">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="fb80c6e845fdf495a414649fed7f605d"></a><!-- doxytag: member="StringSearch::safeClone" ref="fb80c6e845fdf495a414649fed7f605d" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classSearchIterator.html">SearchIterator</a>* StringSearch::safeClone           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a copy of <a class="el" href="classStringSearch.html">StringSearch</a> with the same behavior, and iterating over the same text, as this one. 
<p>
Note that all data will be replicated, except for the user-specified collator and the breakiterator. <dl compact><dt><b>Returns:</b></dt><dd>cloned object </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002578">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Implements <a class="el" href="classSearchIterator.html#1bd52b7976666190a83c904716468b00">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="a21f0da2d58e929d4f0f4d771708f558"></a><!-- doxytag: member="StringSearch::setCollator" ref="a21f0da2d58e929d4f0f4d771708f558" args="(RuleBasedCollator *coll, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StringSearch::setCollator           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classRuleBasedCollator.html">RuleBasedCollator</a> *&nbsp;</td>
          <td class="paramname"> <em>coll</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the collator used for the language rules. 
<p>
User retains the ownership of this collator, thus the responsibility of deletion lies with the user. This method causes internal data such as Boyer-Moore shift tables to be recalculated, but the iterator's position is unchanged. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>coll</em>&nbsp;</td><td>collator </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002574">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="eb51073c3cb7ff0cd206ccdacd1daa96"></a><!-- doxytag: member="StringSearch::setOffset" ref="eb51073c3cb7ff0cd206ccdacd1daa96" args="(int32_t position, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void StringSearch::setOffset           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a>&nbsp;</td>
          <td class="paramname"> <em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the index to point to the given position, and clears any state that's affected. 
<p>
This method takes the argument index and sets the position in the text string accordingly without checking if the index is pointing to a valid starting point to begin searching. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>position</em>&nbsp;</td><td>within the text to be set. If position is less than or greater than the text range for searching, an U_INDEX_OUTOFBOUNDS_ERROR will be returned </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if it occurs </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002569">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Implements <a class="el" href="classSearchIterator.html#4b9876cea84ea2944aa556c0b122225a">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="17616ece77021ca3311d5391421ee190"></a><!-- doxytag: member="StringSearch::setPattern" ref="17616ece77021ca3311d5391421ee190" args="(const UnicodeString &amp;pattern, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StringSearch::setPattern           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the pattern used for matching. 
<p>
Internal data like the Boyer Moore table will be recalculated, but the iterator's position is unchanged. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&nbsp;</td><td>search pattern to be found </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If the pattern length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002575">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

</div>
</div><p>
<a class="anchor" name="68c55e8eafb76362cb047945a8938e21"></a><!-- doxytag: member="StringSearch::setText" ref="68c55e8eafb76362cb047945a8938e21" args="(CharacterIterator &amp;text, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void StringSearch::setText           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCharacterIterator.html">CharacterIterator</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the target text to be searched. 
<p>
Text iteration will hence begin at the start of the text string. This method is useful if you want to re-use an iterator to search for the same pattern within a different body of text. Note: No parsing of the text within the <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be done during searching for this version. The block of text in <code><a class="el" href="classCharacterIterator.html">CharacterIterator</a></code> will be used as it is. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>text string to be searched </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If the text length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002572">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Reimplemented from <a class="el" href="classSearchIterator.html#18b104a47024b07745c5e72e2206a8ca">SearchIterator</a>.
</div>
</div><p>
<a class="anchor" name="93b9fcdedbf91ffa55c25defc767d8e6"></a><!-- doxytag: member="StringSearch::setText" ref="93b9fcdedbf91ffa55c25defc767d8e6" args="(const UnicodeString &amp;text, UErrorCode &amp;status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void StringSearch::setText           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classUnicodeString.html">UnicodeString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#863c11989634c998849cc946d04dfabe">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the target text to be searched. 
<p>
Text iteration will hence begin at the start of the text string. This method is useful if you want to re-use an iterator to search for the same pattern within a different body of text. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>text string to be searched </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>for errors if any. If the text length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned. </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable002571">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl>

<p>
Reimplemented from <a class="el" href="classSearchIterator.html#ba0a80c7dda394918d4e505b39ade627">SearchIterator</a>.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="stsearch_8h-source.html">stsearch.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Dec 13 17:29:55 2011 for ICU 3.6 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>