20 #if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
C++ API: Character Iterator.
The BreakIterator class implements methods for finding the location of boundaries in text.
Abstract class that defines an API for iteration on text objects.
SearchIterator is an abstract base class that provides methods to search for a pattern within a text ...
SearchIterator(CharacterIterator &text, BreakIterator *breakiter=NULL)
Constructor for use by subclasses.
virtual void setMatchStart(int32_t position)
Sets the offset of the currently matched string in the text string to be searched.
virtual void setOffset(int32_t position, UErrorCode &status)=0
Sets the index to point to the given position, and clears any state that's affected.
void getMatchedText(UnicodeString &result) const
Returns the text that was matched by the most recent call to first, next, previous,...
virtual void setText(CharacterIterator &text, UErrorCode &status)
Set the string text to be searched.
int32_t getMatchedLength(void) const
Returns the length of text in the string which matches the search pattern.
UBool operator!=(const SearchIterator &that) const
Not-equal operator.
virtual void setText(const UnicodeString &text, UErrorCode &status)
Set the string text to be searched.
virtual int32_t handleNext(int32_t position, UErrorCode &status)=0
Abstract method which subclasses override to provide the mechanism for finding the next match in the ...
const UnicodeString & getText(void) const
Return the string text to be searched.
virtual void setMatchLength(int32_t length)
Sets the length of the currently matched string in the text string to be searched.
void setMatchNotFound()
sets match not found
BreakIterator * m_breakiterator_
Break iterator.
USearch * m_search_
C search data struct.
virtual int32_t getOffset(void) const =0
Return the current index in the text being searched.
USearchAttributeValue getAttribute(USearchAttribute attribute) const
Gets the text searching attributes.
SearchIterator()
Default constructor.
int32_t preceding(int32_t position, UErrorCode &status)
Returns the first index less than position at which the string text matches the search pattern.
void setBreakIterator(BreakIterator *breakiter, UErrorCode &status)
Set the BreakIterator that will be used to restrict the points at which matches are detected.
int32_t previous(UErrorCode &status)
Returns the index of the previous point at which the string text matches the search pattern,...
int32_t following(int32_t position, UErrorCode &status)
Returns the first index equal or greater than position at which the string text matches the search pa...
virtual SearchIterator * safeClone(void) const =0
Returns a copy of SearchIterator with the same behavior, and iterating over the same text,...
int32_t last(UErrorCode &status)
Returns the last index in the target text at which it matches the search pattern.
SearchIterator(const UnicodeString &text, BreakIterator *breakiter=NULL)
Constructor for use by subclasses.
int32_t getMatchedStart(void) const
Returns the index to the match in the text string that was searched.
int32_t next(UErrorCode &status)
Returns the index of the next point at which the text matches the search pattern, starting from the c...
virtual ~SearchIterator()
Destructor.
SearchIterator(const SearchIterator &other)
Copy constructor that creates a SearchIterator instance with the same behavior, and iterating over th...
int32_t first(UErrorCode &status)
Returns the first index at which the string text matches the search pattern.
virtual void reset()
Resets the iteration.
virtual UBool operator==(const SearchIterator &that) const
Equality operator.
void setAttribute(USearchAttribute attribute, USearchAttributeValue value, UErrorCode &status)
Sets the text searching attributes located in the enum USearchAttribute with values from the enum USe...
SearchIterator & operator=(const SearchIterator &that)
Assignment operator.
UnicodeString m_text_
Unicode string version of the search text.
const BreakIterator * getBreakIterator(void) const
Returns the BreakIterator that is used to restrict the points at which matches are detected.
virtual int32_t handlePrev(int32_t position, UErrorCode &status)=0
Abstract method which subclasses override to provide the mechanism for finding the previous match in ...
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
int8_t UBool
The ICU boolean type.
C++ API: Common ICU base class UObject.
Basic definitions for ICU, for both C and C++ APIs.
#define NULL
Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.