jpayne@69: // © 2016 and later: Unicode, Inc. and others. jpayne@69: // License & terms of use: http://www.unicode.org/copyright.html jpayne@69: /* jpayne@69: ********************************************************************** jpayne@69: * Copyright (C) 2001-2011 IBM and others. All rights reserved. jpayne@69: ********************************************************************** jpayne@69: * Date Name Description jpayne@69: * 03/22/2000 helena Creation. jpayne@69: ********************************************************************** jpayne@69: */ jpayne@69: jpayne@69: #ifndef SEARCH_H jpayne@69: #define SEARCH_H jpayne@69: jpayne@69: #include "unicode/utypes.h" jpayne@69: jpayne@69: #if U_SHOW_CPLUSPLUS_API jpayne@69: jpayne@69: /** jpayne@69: * \file jpayne@69: * \brief C++ API: SearchIterator object. jpayne@69: */ jpayne@69: jpayne@69: #if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: #include "unicode/uobject.h" jpayne@69: #include "unicode/unistr.h" jpayne@69: #include "unicode/chariter.h" jpayne@69: #include "unicode/brkiter.h" jpayne@69: #include "unicode/usearch.h" jpayne@69: jpayne@69: /** jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: struct USearch; jpayne@69: /** jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: typedef struct USearch USearch; jpayne@69: jpayne@69: U_NAMESPACE_BEGIN jpayne@69: jpayne@69: /** jpayne@69: * jpayne@69: * SearchIterator is an abstract base class that provides jpayne@69: * methods to search for a pattern within a text string. Instances of jpayne@69: * SearchIterator maintain a current position and scans over the jpayne@69: * target text, returning the indices the pattern is matched and the length jpayne@69: * of each match. jpayne@69: *
jpayne@69: * SearchIterator defines a protocol for text searching. jpayne@69: * Subclasses provide concrete implementations of various search algorithms. jpayne@69: * For example, StringSearch implements language-sensitive pattern jpayne@69: * matching based on the comparison rules defined in a jpayne@69: * RuleBasedCollator object. jpayne@69: *
jpayne@69: * Other options for searching includes using a BreakIterator to restrict jpayne@69: * the points at which matches are detected. jpayne@69: *
jpayne@69: * SearchIterator provides an API that is similar to that of jpayne@69: * other text iteration classes such as BreakIterator. Using jpayne@69: * this class, it is easy to scan through text looking for all occurances of jpayne@69: * a given pattern. The following example uses a StringSearch jpayne@69: * object to find all instances of "fox" in the target string. Any other jpayne@69: * subclass of SearchIterator can be used in an identical jpayne@69: * manner. jpayne@69: *
jpayne@69: * UnicodeString target("The quick brown fox jumped over the lazy fox");
jpayne@69: * UnicodeString pattern("fox");
jpayne@69: *
jpayne@69: * SearchIterator *iter = new StringSearch(pattern, target);
jpayne@69: * UErrorCode error = U_ZERO_ERROR;
jpayne@69: * for (int pos = iter->first(error); pos != USEARCH_DONE;
jpayne@69: * pos = iter->next(error)) {
jpayne@69: * printf("Found match at %d pos, length is %d\n", pos, iter.getMatchedLength());
jpayne@69: * }
jpayne@69: *
jpayne@69: *
jpayne@69: * @see StringSearch
jpayne@69: * @see RuleBasedCollator
jpayne@69: */
jpayne@69: class U_I18N_API SearchIterator : public UObject {
jpayne@69:
jpayne@69: public:
jpayne@69:
jpayne@69: // public constructors and destructors -------------------------------
jpayne@69:
jpayne@69: /**
jpayne@69: * Copy constructor that creates a SearchIterator instance with the same
jpayne@69: * behavior, and iterating over the same text.
jpayne@69: * @param other the SearchIterator instance to be copied.
jpayne@69: * @stable ICU 2.0
jpayne@69: */
jpayne@69: SearchIterator(const SearchIterator &other);
jpayne@69:
jpayne@69: /**
jpayne@69: * Destructor. Cleans up the search iterator data struct.
jpayne@69: * @stable ICU 2.0
jpayne@69: */
jpayne@69: virtual ~SearchIterator();
jpayne@69:
jpayne@69: // public get and set methods ----------------------------------------
jpayne@69:
jpayne@69: /**
jpayne@69: * Sets the index to point to the given position, and clears any state
jpayne@69: * that's affected.
jpayne@69: * jpayne@69: * This method takes the argument index and sets the position in the text jpayne@69: * string accordingly without checking if the index is pointing to a jpayne@69: * valid starting point to begin searching. jpayne@69: * @param position within the text to be set. If position is less jpayne@69: * than or greater than the text range for searching, jpayne@69: * an U_INDEX_OUTOFBOUNDS_ERROR will be returned jpayne@69: * @param status for errors if it occurs jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void setOffset(int32_t position, UErrorCode &status) = 0; jpayne@69: jpayne@69: /** jpayne@69: * Return the current index in the text being searched. jpayne@69: * If the iteration has gone past the end of the text jpayne@69: * (or past the beginning for a backwards search), USEARCH_DONE jpayne@69: * is returned. jpayne@69: * @return current index in the text being searched. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual int32_t getOffset(void) const = 0; jpayne@69: jpayne@69: /** jpayne@69: * Sets the text searching attributes located in the enum jpayne@69: * USearchAttribute with values from the enum USearchAttributeValue. jpayne@69: * USEARCH_DEFAULT can be used for all attributes for resetting. jpayne@69: * @param attribute text attribute (enum USearchAttribute) to be set jpayne@69: * @param value text attribute value jpayne@69: * @param status for errors if it occurs jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: void setAttribute(USearchAttribute attribute, jpayne@69: USearchAttributeValue value, jpayne@69: UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Gets the text searching attributes jpayne@69: * @param attribute text attribute (enum USearchAttribute) to be retrieve jpayne@69: * @return text attribute value jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: USearchAttributeValue getAttribute(USearchAttribute attribute) const; jpayne@69: jpayne@69: /** jpayne@69: * Returns the index to the match in the text string that was searched. jpayne@69: * This call returns a valid result only after a successful call to jpayne@69: * first, next, previous, or last. jpayne@69: * Just after construction, or after a searching method returns jpayne@69: * USEARCH_DONE, this method will return USEARCH_DONE. jpayne@69: *
jpayne@69: * Use getMatchedLength to get the matched string length. jpayne@69: * @return index of a substring within the text string that is being jpayne@69: * searched. jpayne@69: * @see #first jpayne@69: * @see #next jpayne@69: * @see #previous jpayne@69: * @see #last jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t getMatchedStart(void) const; jpayne@69: jpayne@69: /** jpayne@69: * Returns the length of text in the string which matches the search jpayne@69: * pattern. This call returns a valid result only after a successful call jpayne@69: * to first, next, previous, or last. jpayne@69: * Just after construction, or after a searching method returns jpayne@69: * USEARCH_DONE, this method will return 0. jpayne@69: * @return The length of the match in the target text, or 0 if there jpayne@69: * is no match currently. jpayne@69: * @see #first jpayne@69: * @see #next jpayne@69: * @see #previous jpayne@69: * @see #last jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t getMatchedLength(void) const; jpayne@69: jpayne@69: /** jpayne@69: * Returns the text that was matched by the most recent call to jpayne@69: * first, next, previous, or last. jpayne@69: * If the iterator is not pointing at a valid match (e.g. just after jpayne@69: * construction or after USEARCH_DONE has been returned, jpayne@69: * returns an empty string. jpayne@69: * @param result stores the matched string or an empty string if a match jpayne@69: * is not found. jpayne@69: * @see #first jpayne@69: * @see #next jpayne@69: * @see #previous jpayne@69: * @see #last jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: void getMatchedText(UnicodeString &result) const; jpayne@69: jpayne@69: /** jpayne@69: * Set the BreakIterator that will be used to restrict the points jpayne@69: * at which matches are detected. The user is responsible for deleting jpayne@69: * the breakiterator. jpayne@69: * @param breakiter A BreakIterator that will be used to restrict the jpayne@69: * points at which matches are detected. If a match is jpayne@69: * found, but the match's start or end index is not a jpayne@69: * boundary as determined by the BreakIterator, jpayne@69: * the match will be rejected and another will be searched jpayne@69: * for. If this parameter is NULL, no break jpayne@69: * detection is attempted. jpayne@69: * @param status for errors if it occurs jpayne@69: * @see BreakIterator jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: void setBreakIterator(BreakIterator *breakiter, UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the BreakIterator that is used to restrict the points at jpayne@69: * which matches are detected. This will be the same object that was jpayne@69: * passed to the constructor or to setBreakIterator. jpayne@69: * Note that NULL is a legal value; it means that break jpayne@69: * detection should not be attempted. jpayne@69: * @return BreakIterator used to restrict matchings. jpayne@69: * @see #setBreakIterator jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: const BreakIterator * getBreakIterator(void) const; jpayne@69: jpayne@69: /** jpayne@69: * Set the string text to be searched. Text iteration will hence begin at jpayne@69: * the start of the text string. This method is useful if you want to jpayne@69: * re-use an iterator to search for the same pattern within a different jpayne@69: * body of text. The user is responsible for deleting the text. jpayne@69: * @param text string to be searched. jpayne@69: * @param status for errors. If the text length is 0, jpayne@69: * an U_ILLEGAL_ARGUMENT_ERROR is returned. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void setText(const UnicodeString &text, UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Set the string text to be searched. Text iteration will hence begin at jpayne@69: * the start of the text string. This method is useful if you want to jpayne@69: * re-use an iterator to search for the same pattern within a different jpayne@69: * body of text. jpayne@69: *
jpayne@69: * Note: No parsing of the text within the CharacterIterator jpayne@69: * will be done during searching for this version. The block of text jpayne@69: * in CharacterIterator will be used as it is. jpayne@69: * The user is responsible for deleting the text. jpayne@69: * @param text string iterator to be searched. jpayne@69: * @param status for errors if any. If the text length is 0 then an jpayne@69: * U_ILLEGAL_ARGUMENT_ERROR is returned. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void setText(CharacterIterator &text, UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Return the string text to be searched. jpayne@69: * @return text string to be searched. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: const UnicodeString & getText(void) const; jpayne@69: jpayne@69: // operator overloading ---------------------------------------------- jpayne@69: jpayne@69: /** jpayne@69: * Equality operator. jpayne@69: * @param that SearchIterator instance to be compared. jpayne@69: * @return TRUE if both BreakIterators are of the same class, have the jpayne@69: * same behavior, terates over the same text and have the same jpayne@69: * attributes. FALSE otherwise. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual UBool operator==(const SearchIterator &that) const; jpayne@69: jpayne@69: /** jpayne@69: * Not-equal operator. jpayne@69: * @param that SearchIterator instance to be compared. jpayne@69: * @return FALSE if operator== returns TRUE, and vice versa. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: UBool operator!=(const SearchIterator &that) const; jpayne@69: jpayne@69: // public methods ---------------------------------------------------- jpayne@69: jpayne@69: /** jpayne@69: * Returns a copy of SearchIterator with the same behavior, and jpayne@69: * iterating over the same text, as this one. Note that all data will be jpayne@69: * replicated, except for the text string to be searched. jpayne@69: * @return cloned object jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual SearchIterator* safeClone(void) const = 0; jpayne@69: jpayne@69: /** jpayne@69: * Returns the first index at which the string text matches the search jpayne@69: * pattern. The iterator is adjusted so that its current index (as jpayne@69: * returned by getOffset) is the match position if one jpayne@69: * was found. jpayne@69: * If a match is not found, USEARCH_DONE will be returned and jpayne@69: * the iterator will be adjusted to the index USEARCH_DONE jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The character index of the first match, or jpayne@69: * USEARCH_DONE if there are no matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t first(UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the first index equal or greater than position at which the jpayne@69: * string text matches the search pattern. The iterator is adjusted so jpayne@69: * that its current index (as returned by getOffset) is the jpayne@69: * match position if one was found. jpayne@69: * If a match is not found, USEARCH_DONE will be returned and the jpayne@69: * iterator will be adjusted to the index USEARCH_DONE. jpayne@69: * @param position where search if to start from. If position is less jpayne@69: * than or greater than the text range for searching, jpayne@69: * an U_INDEX_OUTOFBOUNDS_ERROR will be returned jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The character index of the first match following jpayne@69: * position, or USEARCH_DONE if there are no jpayne@69: * matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t following(int32_t position, UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the last index in the target text at which it matches the jpayne@69: * search pattern. The iterator is adjusted so that its current index jpayne@69: * (as returned by getOffset) is the match position if one was jpayne@69: * found. jpayne@69: * If a match is not found, USEARCH_DONE will be returned and jpayne@69: * the iterator will be adjusted to the index USEARCH_DONE. jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The index of the first match, or USEARCH_DONE if jpayne@69: * there are no matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t last(UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the first index less than position at which the string jpayne@69: * text matches the search pattern. The iterator is adjusted so that its jpayne@69: * current index (as returned by getOffset) is the match jpayne@69: * position if one was found. If a match is not found, jpayne@69: * USEARCH_DONE will be returned and the iterator will be jpayne@69: * adjusted to the index USEARCH_DONE jpayne@69: *
jpayne@69: * When USEARCH_OVERLAP option is off, the last index of the jpayne@69: * result match is always less than position. jpayne@69: * When USERARCH_OVERLAP is on, the result match may span across jpayne@69: * position. jpayne@69: * jpayne@69: * @param position where search is to start from. If position is less jpayne@69: * than or greater than the text range for searching, jpayne@69: * an U_INDEX_OUTOFBOUNDS_ERROR will be returned jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The character index of the first match preceding jpayne@69: * position, or USEARCH_DONE if there are jpayne@69: * no matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t preceding(int32_t position, UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the index of the next point at which the text matches the jpayne@69: * search pattern, starting from the current position jpayne@69: * The iterator is adjusted so that its current index (as returned by jpayne@69: * getOffset) is the match position if one was found. jpayne@69: * If a match is not found, USEARCH_DONE will be returned and jpayne@69: * the iterator will be adjusted to a position after the end of the text jpayne@69: * string. jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The index of the next match after the current position, jpayne@69: * or USEARCH_DONE if there are no more matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t next(UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Returns the index of the previous point at which the string text jpayne@69: * matches the search pattern, starting at the current position. jpayne@69: * The iterator is adjusted so that its current index (as returned by jpayne@69: * getOffset) is the match position if one was found. jpayne@69: * If a match is not found, USEARCH_DONE will be returned and jpayne@69: * the iterator will be adjusted to the index USEARCH_DONE jpayne@69: * @param status for errors if it occurs jpayne@69: * @return The index of the previous match before the current position, jpayne@69: * or USEARCH_DONE if there are no more matches. jpayne@69: * @see #getOffset jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: int32_t previous(UErrorCode &status); jpayne@69: jpayne@69: /** jpayne@69: * Resets the iteration. jpayne@69: * Search will begin at the start of the text string if a forward jpayne@69: * iteration is initiated before a backwards iteration. Otherwise if a jpayne@69: * backwards iteration is initiated before a forwards iteration, the jpayne@69: * search will begin at the end of the text string. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void reset(); jpayne@69: jpayne@69: protected: jpayne@69: // protected data members --------------------------------------------- jpayne@69: jpayne@69: /** jpayne@69: * C search data struct jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: USearch *m_search_; jpayne@69: jpayne@69: /** jpayne@69: * Break iterator. jpayne@69: * Currently the C++ breakiterator does not have getRules etc to reproduce jpayne@69: * another in C. Hence we keep the original around and do the verification jpayne@69: * at the end of the match. The user is responsible for deleting this jpayne@69: * break iterator. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: BreakIterator *m_breakiterator_; jpayne@69: jpayne@69: /** jpayne@69: * Unicode string version of the search text jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: UnicodeString m_text_; jpayne@69: jpayne@69: // protected constructors and destructors ----------------------------- jpayne@69: jpayne@69: /** jpayne@69: * Default constructor. jpayne@69: * Initializes data to the default values. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: SearchIterator(); jpayne@69: jpayne@69: /** jpayne@69: * Constructor for use by subclasses. jpayne@69: * @param text The target text to be searched. jpayne@69: * @param breakiter A {@link BreakIterator} that is used to restrict the jpayne@69: * points at which matches are detected. If jpayne@69: * handleNext or handlePrev finds a jpayne@69: * match, but the match's start or end index is not a jpayne@69: * boundary as determined by the BreakIterator, jpayne@69: * the match is rejected and handleNext or jpayne@69: * handlePrev is called again. If this parameter jpayne@69: * is NULL, no break detection is attempted. jpayne@69: * @see #handleNext jpayne@69: * @see #handlePrev jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: SearchIterator(const UnicodeString &text, jpayne@69: BreakIterator *breakiter = NULL); jpayne@69: jpayne@69: /** jpayne@69: * Constructor for use by subclasses. jpayne@69: *
jpayne@69: * Note: No parsing of the text within the CharacterIterator jpayne@69: * will be done during searching for this version. The block of text jpayne@69: * in CharacterIterator will be used as it is. jpayne@69: * @param text The target text to be searched. jpayne@69: * @param breakiter A {@link BreakIterator} that is used to restrict the jpayne@69: * points at which matches are detected. If jpayne@69: * handleNext or handlePrev finds a jpayne@69: * match, but the match's start or end index is not a jpayne@69: * boundary as determined by the BreakIterator, jpayne@69: * the match is rejected and handleNext or jpayne@69: * handlePrev is called again. If this parameter jpayne@69: * is NULL, no break detection is attempted. jpayne@69: * @see #handleNext jpayne@69: * @see #handlePrev jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: SearchIterator(CharacterIterator &text, BreakIterator *breakiter = NULL); jpayne@69: jpayne@69: // protected methods -------------------------------------------------- jpayne@69: jpayne@69: /** jpayne@69: * Assignment operator. Sets this iterator to have the same behavior, jpayne@69: * and iterate over the same text, as the one passed in. jpayne@69: * @param that instance to be copied. jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: SearchIterator & operator=(const SearchIterator &that); jpayne@69: jpayne@69: /** jpayne@69: * Abstract method which subclasses override to provide the mechanism jpayne@69: * for finding the next match in the target text. This allows different jpayne@69: * subclasses to provide different search algorithms. jpayne@69: *
jpayne@69: * If a match is found, the implementation should return the index at jpayne@69: * which the match starts and should call jpayne@69: * setMatchLength with the number of characters jpayne@69: * in the target text that make up the match. If no match is found, the jpayne@69: * method should return USEARCH_DONE. jpayne@69: *
jpayne@69: * @param position The index in the target text at which the search jpayne@69: * should start. jpayne@69: * @param status for error codes if it occurs. jpayne@69: * @return index at which the match starts, else if match is not found jpayne@69: * USEARCH_DONE is returned jpayne@69: * @see #setMatchLength jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual int32_t handleNext(int32_t position, UErrorCode &status) jpayne@69: = 0; jpayne@69: jpayne@69: /** jpayne@69: * Abstract method which subclasses override to provide the mechanism for jpayne@69: * finding the previous match in the target text. This allows different jpayne@69: * subclasses to provide different search algorithms. jpayne@69: *
jpayne@69: * If a match is found, the implementation should return the index at jpayne@69: * which the match starts and should call jpayne@69: * setMatchLength with the number of characters jpayne@69: * in the target text that make up the match. If no match is found, the jpayne@69: * method should return USEARCH_DONE. jpayne@69: *
jpayne@69: * @param position The index in the target text at which the search jpayne@69: * should start. jpayne@69: * @param status for error codes if it occurs. jpayne@69: * @return index at which the match starts, else if match is not found jpayne@69: * USEARCH_DONE is returned jpayne@69: * @see #setMatchLength jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual int32_t handlePrev(int32_t position, UErrorCode &status) jpayne@69: = 0; jpayne@69: jpayne@69: /** jpayne@69: * Sets the length of the currently matched string in the text string to jpayne@69: * be searched. jpayne@69: * Subclasses' handleNext and handlePrev jpayne@69: * methods should call this when they find a match in the target text. jpayne@69: * @param length length of the matched text. jpayne@69: * @see #handleNext jpayne@69: * @see #handlePrev jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void setMatchLength(int32_t length); jpayne@69: jpayne@69: /** jpayne@69: * Sets the offset of the currently matched string in the text string to jpayne@69: * be searched. jpayne@69: * Subclasses' handleNext and handlePrev jpayne@69: * methods should call this when they find a match in the target text. jpayne@69: * @param position start offset of the matched text. jpayne@69: * @see #handleNext jpayne@69: * @see #handlePrev jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: virtual void setMatchStart(int32_t position); jpayne@69: jpayne@69: /** jpayne@69: * sets match not found jpayne@69: * @stable ICU 2.0 jpayne@69: */ jpayne@69: void setMatchNotFound(); jpayne@69: }; jpayne@69: jpayne@69: inline UBool SearchIterator::operator!=(const SearchIterator &that) const jpayne@69: { jpayne@69: return !operator==(that); jpayne@69: } jpayne@69: U_NAMESPACE_END jpayne@69: jpayne@69: #endif /* #if !UCONFIG_NO_COLLATION */ jpayne@69: jpayne@69: #endif /* U_SHOW_CPLUSPLUS_API */ jpayne@69: jpayne@69: #endif jpayne@69: