X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..46f4442e9a5a4f3b98b7c1083586332f6a8a99a4:/icuSources/i18n/unicode/stsearch.h diff --git a/icuSources/i18n/unicode/stsearch.h b/icuSources/i18n/unicode/stsearch.h index 565f1e6a..8499752e 100644 --- a/icuSources/i18n/unicode/stsearch.h +++ b/icuSources/i18n/unicode/stsearch.h @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2001-2004 IBM and others. All rights reserved. +* Copyright (C) 2001-2008 IBM and others. All rights reserved. ********************************************************************** * Date Name Description * 03/22/2000 helena Creation. @@ -12,7 +12,12 @@ #include "unicode/utypes.h" -#if !UCONFIG_NO_COLLATION +/** + * \file + * \brief C++ API: Service for searching text based on RuleBasedCollator. + */ + +#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION #include "unicode/tblcoll.h" #include "unicode/coleitr.h" @@ -20,19 +25,20 @@ U_NAMESPACE_BEGIN -/** +/** + * * StringSearch is a SearchIterator that provides * language-sensitive text searching based on the comparison rules defined * in a {@link RuleBasedCollator} object. * StringSearch ensures that language eccentricity can be - * handled, e.g. for the German collator, characters ß and SS will be matched + * handled, e.g. for the German collator, characters ß and SS will be matched * if case is chosen to be ignored. - * See the + * See the * "ICU Collation Design Document" for more information. *
* The algorithm implemented is a modified form of the Boyer Moore's search. * For more information see - * + * * "Efficient Text Searching in Java", published in Java Report * in February, 1999, for further information on the algorithm. *
@@ -49,7 +55,7 @@ U_NAMESPACE_BEGIN * there exists no non-ignorable combining mark before or after S? * in S respectively. * - * Option 2. will be the default· + * Option 2. will be the default. *
* This search has APIs similar to that of other text iteration mechanisms * such as the break iterators in BreakIterator. Using these @@ -108,13 +114,15 @@ U_NAMESPACE_BEGIN * and examples of how to use instances of this class to implement text * searching. *
- * UnicodeString target("The quick brown fox jumped over the lazy fox");
+ * UnicodeString target("The quick brown fox jumps over the lazy dog.");
* UnicodeString pattern("fox");
*
- * SearchIterator *iter = new StringSearch(pattern, target);
* UErrorCode error = U_ZERO_ERROR;
- * for (int pos = iter->first(error); pos != USEARCH_DONE;
- * pos = iter->next(error)) {
+ * StringSearch iter(pattern, target, Locale::getUS(), NULL, status);
+ * for (int pos = iter.first(error);
+ * pos != USEARCH_DONE;
+ * pos = iter.next(error))
+ * {
* printf("Found match at %d pos, length is %d\n", pos,
* iter.getMatchLength());
* }
@@ -270,7 +278,7 @@ public:
* @return a clone of this object
*
* @see getDynamicClassID
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
StringSearch *clone() const;
@@ -495,11 +503,6 @@ private :
*/
UnicodeString m_pattern_;
/**
- * Corresponding collation rules
- * @stable ICU 2.0
- */
- UnicodeString m_collation_rules_;
- /**
* String search struct data
* @stable ICU 2.0
*/