1 // © 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 4 ******************************************************************************** 5 * Copyright (C) 1997-2016, International Business Machines 6 * Corporation and others. All Rights Reserved. 7 ******************************************************************************** 11 * Modification History: 13 * Date Name Description 14 * 02/18/97 aliu Added typedef for TextCount. Made DONE const. 15 * 05/07/97 aliu Fixed DLL declaration. 16 * 07/09/97 jfitz Renamed BreakIterator and interface synced with JDK 17 * 08/11/98 helena Sync-up JDK1.2. 18 * 01/13/2000 helena Added UErrorCode parameter to createXXXInstance methods. 19 ******************************************************************************** 34 #if U_SHOW_CPLUSPLUS_API 36 #if UCONFIG_NO_BREAK_ITERATION 41 * Allow the declaration of APIs with pointers to BreakIterator 42 * even when break iteration is removed from the build. 224 DONE =
static_cast<int32_t
>(-1)
303 virtual int32_t
next(int32_t n) = 0;
439 #ifndef U_HIDE_DEPRECATED_API 464 #endif/* U_HIDE_DEPRECATED_API */ 487 constLocale& displayLocale,
501 #ifndef U_FORCE_HIDE_DEPRECATED_API 524 #endif// U_FORCE_HIDE_DEPRECATED_API 526 #ifndef U_HIDE_DEPRECATED_API 534 inlineUBool isBufferClone();
536 #endif/* U_HIDE_DEPRECATED_API */ 538 #if !UCONFIG_NO_SERVICE 589 #ifndef U_HIDE_INTERNAL_API 597 #endif/* U_HIDE_INTERNAL_API */ 631 friendclassICUBreakIteratorFactory;
632 friendclassICUBreakIteratorService;
635 // Do not enclose protected default/copy constructors with #ifndef U_HIDE_INTERNAL_API 636 // or else the compiler will create a public ones. 641 #ifndef U_HIDE_INTERNAL_API 646 #endif/* U_HIDE_INTERNAL_API */ 651 CharString* actualLocale =
nullptr;
652 CharString* validLocale =
nullptr;
653 CharString* requestLocale =
nullptr;
656 #ifndef U_HIDE_DEPRECATED_API 658 inlineUBool BreakIterator::isBufferClone()
663 #endif/* U_HIDE_DEPRECATED_API */ 667 #endif/* #if !UCONFIG_NO_BREAK_ITERATION */ 669 #endif/* U_SHOW_CPLUSPLUS_API */ C++ API: Character Iterator.
The BreakIterator class implements methods for finding the location of boundaries in text.
virtual bool operator==(const BreakIterator &) const =0
Return true if another object is semantically equal to this one.
virtual ~BreakIterator()
destructor
static UnicodeString & getDisplayName(const Locale &objectLocale, UnicodeString &name)
Get name of the object for the desired Locale, in the language of the default locale.
BreakIterator(const Locale &valid, const Locale &actual)
BreakIterator(const BreakIterator &other)
static BreakIterator * createSentenceInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for sentence-breaks using specified locale Returns an instance of a BreakIterato...
virtual int32_t previous()=0
Set the iterator position to the boundary preceding the current boundary.
static BreakIterator * createWordInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for word-breaks using the given locale.
virtual int32_t getRuleStatus() const
For RuleBasedBreakIterators, return the status tag from the break rule that determined the boundary a...
virtual BreakIterator * clone() const =0
Return a polymorphic copy of this object.
static const Locale * getAvailableLocales(int32_t &count)
Get the set of Locales for which TextBoundaries are installed.
virtual void adoptText(CharacterIterator *it)=0
Change the text over which this operates.
virtual void setText(UText *text, UErrorCode &status)=0
Reset the break iterator to operate over the text represented by the UText.
virtual int32_t last()=0
Set the iterator position to the index immediately BEYOND the last character in the text being scanne...
static BreakIterator * createTitleInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for title-casing breaks using the specified locale Returns an instance of a Brea...
virtual int32_t next()=0
Advance the iterator to the boundary following the current boundary.
virtual int32_t first()=0
Sets the current iteration position to the beginning of the text, position zero.
const char * getLocaleID(ULocDataLocaleType type, UErrorCode &status) const
Get the locale for this break iterator object.
Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const
Returns the locale for this break iterator.
bool operator!=(const BreakIterator &rhs) const
Returns the complement of the result of operator==.
virtual BreakIterator & refreshInputText(UText *input, UErrorCode &status)=0
Set the subject text string upon which the break iterator is operating without changing any other asp...
virtual void setText(const UnicodeString &text)=0
Change the text over which this operates.
virtual int32_t next(int32_t n)=0
Set the iterator position to the nth boundary from the current boundary.
virtual int32_t preceding(int32_t offset)=0
Set the iterator position to the first boundary preceding the specified offset.
virtual CharacterIterator & getText() const =0
Return a CharacterIterator over the text being analyzed.
virtual int32_t current() const =0
Return character index of the current iterator position within the text.
virtual UBool isBoundary(int32_t offset)=0
Return true if the specified position is a boundary position.
static UnicodeString & getDisplayName(const Locale &objectLocale, const Locale &displayLocale, UnicodeString &name)
Get name of the object for the desired Locale, in the desired language.
virtual UClassID getDynamicClassID() const override=0
Return a polymorphic class ID for this object.
virtual BreakIterator * createBufferClone(void *stackBuffer, int32_t &BufferSize, UErrorCode &status)=0
Deprecated functionality.
static UBool unregister(URegistryKey key, UErrorCode &status)
Unregister a previously-registered BreakIterator using the key returned from the register call.
static BreakIterator * createLineInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for line-breaks using specified locale.
static BreakIterator * createCharacterInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for character-breaks using specified locale Returns an instance of a BreakIterat...
static StringEnumeration * getAvailableLocales()
Return a StringEnumeration over the locales available at the time of the call, including registered l...
virtual int32_t following(int32_t offset)=0
Advance the iterator to the first boundary following the specified offset.
static URegistryKey registerInstance(BreakIterator *toAdopt, const Locale &locale, UBreakIteratorType kind, UErrorCode &status)
Register a new break iterator of the indicated kind, to use in the given locale.
virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status)
For RuleBasedBreakIterators, get the status (tag) values from the break rule(s) that determined the b...
virtual UText * getUText(UText *fillIn, UErrorCode &status) const =0
Get a UText for the text being analyzed.
Abstract class that defines an API for iteration on text objects.
A Locale object represents a specific geographical, political, or cultural region.
Base class for 'pure' C++ implementations of uenum api.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C++ API: Locale ID object.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
C++ API: String Enumeration.
UBreakIteratorType
The possible types of text boundaries.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
int8_t UBool
The ICU boolean type, a signed-byte integer.
C API: Miscellaneous definitions.
const void * URegistryKey
Opaque type returned by registerInstance, registerFactory and unregister for service registration.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
C API: Abstract Unicode Text API.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.