ICU 71.1 71.1

filteredbrk.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ********************************************************************************
5 * Copyright (C) 1997-2015, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ********************************************************************************
8 */
9
10 #ifndef FILTEREDBRK_H
11 #define FILTEREDBRK_H
12
13 #include "unicode/utypes.h"
14
15 #if U_SHOW_CPLUSPLUS_API
16
17 #include "unicode/brkiter.h"
18
19 #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
20
21 U_NAMESPACE_BEGIN
22
39 class U_COMMON_API FilteredBreakIteratorBuilder : public UObject {
40 public:
45 virtual ~FilteredBreakIteratorBuilder();
46
59 static FilteredBreakIteratorBuilder *createInstance(const Locale& where, UErrorCode& status);
60
61 #ifndef U_HIDE_DEPRECATED_API
62
70 static FilteredBreakIteratorBuilder *createInstance(UErrorCode &status);
71 #endif /* U_HIDE_DEPRECATED_API */
72
80 static FilteredBreakIteratorBuilder *createEmptyInstance(UErrorCode &status);
81
92 virtual UBool suppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
93
105 virtual UBool unsuppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
106
107 #ifndef U_FORCE_HIDE_DEPRECATED_API
108
117 virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) = 0;
118 #endif // U_FORCE_HIDE_DEPRECATED_API
119
133 inline BreakIterator *wrapIteratorWithFilter(BreakIterator* adoptBreakIterator, UErrorCode& status) {
134 return build(adoptBreakIterator, status);
135 }
136
137 protected:
142 FilteredBreakIteratorBuilder();
143 };
144
145
146 U_NAMESPACE_END
147
148 #endif // #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
149
150 #endif /* U_SHOW_CPLUSPLUS_API */
151
152 #endif // #ifndef FILTEREDBRK_H
icu::BreakIterator
The BreakIterator class implements methods for finding the location of boundaries in text.
Definition: brkiter.h:106
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
U_COMMON_API
#define U_COMMON_API
Definition: utypes.h:300
brkiter.h
C++ API: Break Iterator.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:295
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
icu::FilteredBreakIteratorBuilder
The BreakIteratorFilter is used to modify the behavior of a BreakIterator by constructing a new Break...
Definition: filteredbrk.h:39
icu::FilteredBreakIteratorBuilder::wrapIteratorWithFilter
BreakIterator * wrapIteratorWithFilter(BreakIterator *adoptBreakIterator, UErrorCode &status)
Wrap (adopt) an existing break iterator in a new filtered instance.
Definition: filteredbrk.h:133
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:195