+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
-* Copyright (C) 2008, International Business Machines
+* Copyright (C) 2008-2015, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
#include "unicode/translit.h"
+#include "unicode/localpointer.h"
+
U_NAMESPACE_BEGIN
class BreakTransliterator : public Transliterator {
public:
- BreakTransliterator(const UnicodeString &ID,
- UnicodeFilter *adoptedFilter,
- BreakIterator *bi,
- const UnicodeString &insertion);
/**
* Constructs a transliterator.
* @param adoptedFilter the filter for this transliterator.
virtual const UnicodeString &getInsertion() const;
- virtual void setInsertsion(const UnicodeString &insertion);
-
- /**
- * Return the break iterator used by this transliterator.
- * Caution, this is the live break iterator; it must not be used while
- * there is any possibility that this transliterator is using it.
- */
- virtual BreakIterator *getBreakIterator();
-
+ virtual void setInsertion(const UnicodeString &insertion);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
UBool isIncremental) const;
private:
- BreakIterator *bi;
- UnicodeString fInsertion;
- UVector32 *boundaries;
- UnicodeString sText; // text from handleTransliterate().
+ LocalPointer<BreakIterator> cachedBI;
+ LocalPointer<UVector32> cachedBoundaries;
+ UnicodeString fInsertion;
static UnicodeString replaceableAsString(Replaceable &r);