00001 /* 00002 ****************************************************************************** 00003 * Copyright (C) 1996-2011, International Business Machines * 00004 * Corporation and others. All Rights Reserved. * 00005 ****************************************************************************** 00006 */ 00007 00014 #ifndef B_M_SEARCH_H 00015 #define B_M_SEARCH_H 00016 00017 #include "unicode/utypes.h" 00018 00019 #if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION 00020 00021 #include "unicode/uobject.h" 00022 #include "unicode/ucol.h" 00023 00024 #include "unicode/colldata.h" 00025 00026 U_NAMESPACE_BEGIN 00027 00028 class BadCharacterTable; 00029 class GoodSuffixTable; 00030 class Target; 00031 00032 #ifndef U_HIDE_INTERNAL_API 00033 00108 class U_I18N_API BoyerMooreSearch : public UObject 00109 { 00110 public: 00126 BoyerMooreSearch(CollData *theData, const UnicodeString &patternString, const UnicodeString *targetString, UErrorCode &status); 00127 00133 ~BoyerMooreSearch(); 00134 00142 UBool empty(); 00143 00155 UBool search(int32_t offset, int32_t &start, int32_t &end); 00156 00165 void setTargetString(const UnicodeString *targetString, UErrorCode &status); 00166 00167 // **** no longer need these? **** 00175 CollData *getData(); 00176 00184 CEList *getPatternCEs(); 00185 00193 BadCharacterTable *getBadCharacterTable(); 00194 00202 GoodSuffixTable *getGoodSuffixTable(); 00203 00208 virtual UClassID getDynamicClassID() const; 00213 static UClassID getStaticClassID(); 00214 00215 private: 00216 CollData *data; 00217 CEList *patCEs; 00218 BadCharacterTable *badCharacterTable; 00219 GoodSuffixTable *goodSuffixTable; 00220 UnicodeString pattern; 00221 Target *target; 00222 }; 00223 #endif /* U_HIDE_INTERNAL_API */ 00224 00225 U_NAMESPACE_END 00226 00227 #endif // #if !UCONFIG_NO_COLLATION 00228 #endif // #ifndef B_M_SEARCH_H