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