ICU 50.1.2  50.1.2
bmsearch.h
Go to the documentation of this file.
1 /*
2  ******************************************************************************
3  * Copyright (C) 1996-2011, International Business Machines *
4  * Corporation and others. All Rights Reserved. *
5  ******************************************************************************
6  */
7 
14 #ifndef B_M_SEARCH_H
15 #define B_M_SEARCH_H
16 
17 #include "unicode/utypes.h"
18 
19 #if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
20 
21 #include "unicode/uobject.h"
22 #include "unicode/ucol.h"
23 
24 #include "unicode/colldata.h"
25 
27 
28 class BadCharacterTable;
29 class GoodSuffixTable;
30 class Target;
31 
32 #ifndef U_HIDE_INTERNAL_API
33 
109 {
110 public:
126  BoyerMooreSearch(CollData *theData, const UnicodeString &patternString, const UnicodeString *targetString, UErrorCode &status);
127 
133  ~BoyerMooreSearch();
134 
142  UBool empty();
143 
155  UBool search(int32_t offset, int32_t &start, int32_t &end);
156 
165  void setTargetString(const UnicodeString *targetString, UErrorCode &status);
166 
167  // **** no longer need these? ****
175  CollData *getData();
176 
184  CEList *getPatternCEs();
185 
193  BadCharacterTable *getBadCharacterTable();
194 
202  GoodSuffixTable *getGoodSuffixTable();
203 
208  virtual UClassID getDynamicClassID() const;
213  static UClassID getStaticClassID();
214 
215 private:
216  CollData *data;
217  CEList *patCEs;
218  BadCharacterTable *badCharacterTable;
219  GoodSuffixTable *goodSuffixTable;
220  UnicodeString pattern;
221  Target *target;
222 };
223 #endif /* U_HIDE_INTERNAL_API */
224 
226 
227 #endif // #if !UCONFIG_NO_COLLATION
228 #endif // #ifndef B_M_SEARCH_H
CollData.
Definition: colldata.h:282
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
This object holds a list of CEs generated from a particular UnicodeString
Definition: colldata.h:67
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
C++ API: Collation data used to compute minLengthInChars.
BoyerMooreSearch.
Definition: bmsearch.h:108
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:358
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
C API: Collator.
C++ API: Common ICU base class UObject.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
Basic definitions for ICU, for both C and C++ APIs.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:246
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:229
int8_t UBool
The ICU boolean type.
Definition: umachine.h:200