ICU 50.2 50.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
13
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
28class BadCharacterTable;
29class GoodSuffixTable;
30class Target;
31
32#ifndef U_HIDE_INTERNAL_API
109{
110public:
126 BoyerMooreSearch(CollData *theData, const UnicodeString &patternString, const UnicodeString *targetString, UErrorCode &status);
127
134
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? ****
176
185
193 BadCharacterTable *getBadCharacterTable();
194
202 GoodSuffixTable *getGoodSuffixTable();
203
214
215private:
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
BoyerMooreSearch(CollData *theData, const UnicodeString &patternString, const UnicodeString *targetString, UErrorCode &status)
Construct a BoyerMooreSearch object.
CollData * getData()
Return the CollData object used for searching.
CEList * getPatternCEs()
Return the CEs generated by the pattern string.
virtual UClassID getDynamicClassID() const
UObject glue...
GoodSuffixTable * getGoodSuffixTable()
Return the GoodSuffixTable object computed for the pattern string.
UBool search(int32_t offset, int32_t &start, int32_t &end)
Search for the pattern string in the target string.
~BoyerMooreSearch()
The desstructor.
void setTargetString(const UnicodeString *targetString, UErrorCode &status)
Set the target string for the match.
UBool empty()
Test the pattern to see if it generates any CEs.
static UClassID getStaticClassID()
UObject glue...
BadCharacterTable * getBadCharacterTable()
Return the BadCharacterTable object computed for the pattern string.
This object holds a list of CEs generated from a particular UnicodeString
Definition colldata.h:68
CollData.
Definition colldata.h:283
UObject is the common ICU "boilerplate" class.
Definition uobject.h:229
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition unistr.h:247
C++ API: Collation data used to compute minLengthInChars.
C API: Collator.
int8_t UBool
The ICU boolean type.
Definition umachine.h:200
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:476
#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_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:130
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:129