Movatterモバイル変換


[0]ホーム

URL:


ICU 77.1  77.1
brkiter.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-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ********************************************************************************
8 *
9 * File brkiter.h
10 *
11 * Modification History:
12 *
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 ********************************************************************************
20 */
21 
22 #ifndef BRKITER_H
23 #define BRKITER_H
24 
25 #include "unicode/utypes.h"
26 
32 #include "unicode/utypes.h"
33 
34 #if U_SHOW_CPLUSPLUS_API
35 
36 #if UCONFIG_NO_BREAK_ITERATION
37 
38 U_NAMESPACE_BEGIN
39 
40 /*
41  * Allow the declaration of APIs with pointers to BreakIterator
42  * even when break iteration is removed from the build.
43  */
44 classBreakIterator;
45 
46 U_NAMESPACE_END
47 
48 #else
49 
50 #include "unicode/uobject.h"
51 #include "unicode/unistr.h"
52 #include "unicode/chariter.h"
53 #include "unicode/locid.h"
54 #include "unicode/ubrk.h"
55 #include "unicode/strenum.h"
56 #include "unicode/utext.h"
57 #include "unicode/umisc.h"
58 
59 U_NAMESPACE_BEGIN
60 
61 classCharString;
62 
108 classU_COMMON_APIBreakIterator :publicUObject {
109 public:
114 virtual~BreakIterator();
115 
129 virtualbooloperator==(constBreakIterator&)const = 0;
130 
137 booloperator!=(constBreakIterator& rhs) const{return !operator==(rhs); }
138 
144 virtualBreakIterator*clone()const = 0;
145 
151 virtualUClassIDgetDynamicClassID()const override = 0;
152 
157 virtualCharacterIterator&getText()const = 0;
158 
173 virtualUText *getUText(UText *fillIn,UErrorCode &status)const = 0;
174 
186 virtualvoidsetText(constUnicodeString &text) = 0;
187 
206 virtualvoidsetText(UText *text,UErrorCode &status) = 0;
207 
216 virtualvoidadoptText(CharacterIterator* it) = 0;
217 
218 enum {
224  DONE =static_cast<int32_t>(-1)
225  };
226 
232 virtual int32_tfirst() = 0;
233 
239 virtual int32_tlast() = 0;
240 
247 virtual int32_tprevious() = 0;
248 
255 virtual int32_tnext() = 0;
256 
262 virtual int32_tcurrent()const = 0;
263 
272 virtual int32_tfollowing(int32_t offset) = 0;
273 
282 virtual int32_tpreceding(int32_t offset) = 0;
283 
292 virtualUBoolisBoundary(int32_t offset) = 0;
293 
303 virtual int32_tnext(int32_t n) = 0;
304 
318 virtual int32_tgetRuleStatus()const;
319 
348 virtual int32_tgetRuleStatusVec(int32_t *fillInVec, int32_t capacity,UErrorCode &status);
349 
369 staticBreakIterator* U_EXPORT2
370 createWordInstance(constLocale& where,UErrorCode& status);
371 
393 staticBreakIterator* U_EXPORT2
394 createLineInstance(constLocale& where,UErrorCode& status);
395 
415 staticBreakIterator* U_EXPORT2
416 createCharacterInstance(constLocale& where,UErrorCode& status);
417 
436 staticBreakIterator* U_EXPORT2
437 createSentenceInstance(constLocale& where,UErrorCode& status);
438 
439 #ifndef U_HIDE_DEPRECATED_API
462 staticBreakIterator* U_EXPORT2
463 createTitleInstance(constLocale& where,UErrorCode& status);
464 #endif/* U_HIDE_DEPRECATED_API */
465 
475 staticconstLocale* U_EXPORT2getAvailableLocales(int32_t& count);
476 
486 staticUnicodeString& U_EXPORT2getDisplayName(constLocale& objectLocale,
487 constLocale& displayLocale,
488 UnicodeString& name);
489 
498 staticUnicodeString& U_EXPORT2getDisplayName(constLocale& objectLocale,
499 UnicodeString& name);
500 
501 #ifndef U_FORCE_HIDE_DEPRECATED_API
521 virtualBreakIterator *createBufferClone(void *stackBuffer,
522  int32_t &BufferSize,
523 UErrorCode &status) = 0;
524 #endif// U_FORCE_HIDE_DEPRECATED_API
525 
526 #ifndef U_HIDE_DEPRECATED_API
527 
534 inlineUBool isBufferClone();
535 
536 #endif/* U_HIDE_DEPRECATED_API */
537 
538 #if !UCONFIG_NO_SERVICE
554 staticURegistryKey U_EXPORT2registerInstance(BreakIterator* toAdopt,
555 constLocale& locale,
556 UBreakIteratorType kind,
557 UErrorCode& status);
558 
571 staticUBool U_EXPORT2unregister(URegistryKey key,UErrorCode& status);
572 
579 staticStringEnumeration* U_EXPORT2getAvailableLocales();
580 #endif
581 
587 LocalegetLocale(ULocDataLocaleType type,UErrorCode& status)const;
588 
589 #ifndef U_HIDE_INTERNAL_API
596 constchar *getLocaleID(ULocDataLocaleType type,UErrorCode& status)const;
597 #endif/* U_HIDE_INTERNAL_API */
598 
624 virtualBreakIterator &refreshInputText(UText *input,UErrorCode &status) = 0;
625 
626 private:
627 staticBreakIterator* buildInstance(constLocale& loc,constchar *type,UErrorCode& status);
628 staticBreakIterator* createInstance(constLocale& loc, int32_t kind,UErrorCode& status);
629 staticBreakIterator* makeInstance(constLocale& loc, int32_t kind,UErrorCode& status);
630 
631 friendclassICUBreakIteratorFactory;
632 friendclassICUBreakIteratorService;
633 
634 protected:
635 // Do not enclose protected default/copy constructors with #ifndef U_HIDE_INTERNAL_API
636 // or else the compiler will create a public ones.
638 BreakIterator();
640 BreakIterator (constBreakIterator &other);
641 #ifndef U_HIDE_INTERNAL_API
643 BreakIterator (constLocale& valid,constLocale &actual);
645 BreakIterator &operator = (constBreakIterator &other);
646 #endif/* U_HIDE_INTERNAL_API */
647 
648 private:
649 
651  CharString* actualLocale =nullptr;
652  CharString* validLocale =nullptr;
653  CharString* requestLocale =nullptr;
654 };
655 
656 #ifndef U_HIDE_DEPRECATED_API
657 
658 inlineUBool BreakIterator::isBufferClone()
659 {
660 returnfalse;
661 }
662 
663 #endif/* U_HIDE_DEPRECATED_API */
664 
665 U_NAMESPACE_END
666 
667 #endif/* #if !UCONFIG_NO_BREAK_ITERATION */
668 
669 #endif/* U_SHOW_CPLUSPLUS_API */
670 
671 #endif// BRKITER_H
672 //eof
chariter.h
C++ API: Character Iterator.
icu::BreakIterator
The BreakIterator class implements methods for finding the location of boundaries in text.
Definition:brkiter.h:108
icu::BreakIterator::operator==
virtual bool operator==(const BreakIterator &) const =0
Return true if another object is semantically equal to this one.
icu::BreakIterator::~BreakIterator
virtual ~BreakIterator()
destructor
icu::BreakIterator::getDisplayName
static UnicodeString & getDisplayName(const Locale &objectLocale, UnicodeString &name)
Get name of the object for the desired Locale, in the language of the default locale.
icu::BreakIterator::BreakIterator
BreakIterator(const Locale &valid, const Locale &actual)
icu::BreakIterator::BreakIterator
BreakIterator(const BreakIterator &other)
icu::BreakIterator::createSentenceInstance
static BreakIterator * createSentenceInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for sentence-breaks using specified locale Returns an instance of a BreakIterato...
icu::BreakIterator::previous
virtual int32_t previous()=0
Set the iterator position to the boundary preceding the current boundary.
icu::BreakIterator::createWordInstance
static BreakIterator * createWordInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for word-breaks using the given locale.
icu::BreakIterator::BreakIterator
BreakIterator()
icu::BreakIterator::getRuleStatus
virtual int32_t getRuleStatus() const
For RuleBasedBreakIterators, return the status tag from the break rule that determined the boundary a...
icu::BreakIterator::clone
virtual BreakIterator * clone() const =0
Return a polymorphic copy of this object.
icu::BreakIterator::getAvailableLocales
static const Locale * getAvailableLocales(int32_t &count)
Get the set of Locales for which TextBoundaries are installed.
icu::BreakIterator::adoptText
virtual void adoptText(CharacterIterator *it)=0
Change the text over which this operates.
icu::BreakIterator::setText
virtual void setText(UText *text, UErrorCode &status)=0
Reset the break iterator to operate over the text represented by the UText.
icu::BreakIterator::last
virtual int32_t last()=0
Set the iterator position to the index immediately BEYOND the last character in the text being scanne...
icu::BreakIterator::createTitleInstance
static BreakIterator * createTitleInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for title-casing breaks using the specified locale Returns an instance of a Brea...
icu::BreakIterator::next
virtual int32_t next()=0
Advance the iterator to the boundary following the current boundary.
icu::BreakIterator::first
virtual int32_t first()=0
Sets the current iteration position to the beginning of the text, position zero.
icu::BreakIterator::getLocaleID
const char * getLocaleID(ULocDataLocaleType type, UErrorCode &status) const
Get the locale for this break iterator object.
icu::BreakIterator::getLocale
Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const
Returns the locale for this break iterator.
icu::BreakIterator::operator!=
bool operator!=(const BreakIterator &rhs) const
Returns the complement of the result of operator==.
Definition:brkiter.h:137
icu::BreakIterator::refreshInputText
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...
icu::BreakIterator::setText
virtual void setText(const UnicodeString &text)=0
Change the text over which this operates.
icu::BreakIterator::next
virtual int32_t next(int32_t n)=0
Set the iterator position to the nth boundary from the current boundary.
icu::BreakIterator::preceding
virtual int32_t preceding(int32_t offset)=0
Set the iterator position to the first boundary preceding the specified offset.
icu::BreakIterator::getText
virtual CharacterIterator & getText() const =0
Return a CharacterIterator over the text being analyzed.
icu::BreakIterator::current
virtual int32_t current() const =0
Return character index of the current iterator position within the text.
icu::BreakIterator::isBoundary
virtual UBool isBoundary(int32_t offset)=0
Return true if the specified position is a boundary position.
icu::BreakIterator::getDisplayName
static UnicodeString & getDisplayName(const Locale &objectLocale, const Locale &displayLocale, UnicodeString &name)
Get name of the object for the desired Locale, in the desired language.
icu::BreakIterator::getDynamicClassID
virtual UClassID getDynamicClassID() const override=0
Return a polymorphic class ID for this object.
icu::BreakIterator::createBufferClone
virtual BreakIterator * createBufferClone(void *stackBuffer, int32_t &BufferSize, UErrorCode &status)=0
Deprecated functionality.
icu::BreakIterator::unregister
static UBool unregister(URegistryKey key, UErrorCode &status)
Unregister a previously-registered BreakIterator using the key returned from the register call.
icu::BreakIterator::createLineInstance
static BreakIterator * createLineInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for line-breaks using specified locale.
icu::BreakIterator::createCharacterInstance
static BreakIterator * createCharacterInstance(const Locale &where, UErrorCode &status)
Create BreakIterator for character-breaks using specified locale Returns an instance of a BreakIterat...
icu::BreakIterator::getAvailableLocales
static StringEnumeration * getAvailableLocales()
Return a StringEnumeration over the locales available at the time of the call, including registered l...
icu::BreakIterator::following
virtual int32_t following(int32_t offset)=0
Advance the iterator to the first boundary following the specified offset.
icu::BreakIterator::registerInstance
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.
icu::BreakIterator::getRuleStatusVec
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...
icu::BreakIterator::getUText
virtual UText * getUText(UText *fillIn, UErrorCode &status) const =0
Get a UText for the text being analyzed.
icu::CharacterIterator
Abstract class that defines an API for iteration on text objects.
Definition:chariter.h:361
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition:locid.h:195
icu::StringEnumeration
Base class for 'pure' C++ implementations of uenum api.
Definition:strenum.h:61
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition:uobject.h:223
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition:unistr.h:296
locid.h
C++ API: Locale ID object.
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
strenum.h
C++ API: String Enumeration.
UText
UText struct.
Definition:utext.h:1328
ubrk.h
C API: BreakIterator.
UBreakIteratorType
UBreakIteratorType
The possible types of text boundaries.
Definition:ubrk.h:102
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
Definition:uloc.h:338
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition:umachine.h:247
umisc.h
C API: Miscellaneous definitions.
URegistryKey
const void * URegistryKey
Opaque type returned by registerInstance, registerFactory and unregister for service registration.
Definition:umisc.h:57
unistr.h
C++ API: Unicode String.
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition:uobject.h:96
utext.h
C API: Abstract Unicode Text API.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition:utypes.h:430
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition:utypes.h:315

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp