]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/brktrans.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 2008-2015, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8 * Date Name Description
9 * 05/11/2008 Andy Heninger Ported from Java
10 **********************************************************************
15 #include "unicode/utypes.h"
17 #if !UCONFIG_NO_TRANSLITERATION && !UCONFIG_NO_BREAK_ITERATION
19 #include "unicode/translit.h"
21 #include "unicode/localpointer.h"
29 * A transliterator that pInserts the specified characters at word breaks.
30 * To restrict it to particular characters, use a filter.
31 * TODO: this is an internal class, and only temporary.
32 * Remove it once we have \b notation in Transliterator.
34 class BreakTransliterator
: public Transliterator
{
38 * Constructs a transliterator.
39 * @param adoptedFilter the filter for this transliterator.
41 BreakTransliterator(UnicodeFilter
* adoptedFilter
= 0);
46 virtual ~BreakTransliterator();
51 BreakTransliterator(const BreakTransliterator
&);
55 * @return A copy of the object.
57 virtual BreakTransliterator
* clone() const;
59 virtual const UnicodeString
&getInsertion() const;
61 virtual void setInsertion(const UnicodeString
&insertion
);
64 * ICU "poor man's RTTI", returns a UClassID for the actual class.
66 virtual UClassID
getDynamicClassID() const;
69 * ICU "poor man's RTTI", returns a UClassID for this class.
71 U_I18N_API
static UClassID U_EXPORT2
getStaticClassID();
76 * Implements {@link Transliterator#handleTransliterate}.
77 * @param text the buffer holding transliterated and
78 * untransliterated text
79 * @param offset the start and limit of the text, the position
80 * of the cursor, and the start and limit of transliteration.
81 * @param incremental if true, assume more text may be coming after
82 * pos.contextLimit. Otherwise, assume the text is complete.
84 virtual void handleTransliterate(Replaceable
& text
, UTransPosition
& offset
,
85 UBool isIncremental
) const;
88 LocalPointer
<BreakIterator
> cachedBI
;
89 LocalPointer
<UVector32
> cachedBoundaries
;
90 UnicodeString fInsertion
;
92 static UnicodeString
replaceableAsString(Replaceable
&r
);
95 * Assignment operator.
97 BreakTransliterator
& operator=(const BreakTransliterator
&);
102 #endif /* #if !UCONFIG_NO_TRANSLITERATION */