17#if U_SHOW_CPLUSPLUS_API
24#if !UCONFIG_NO_TRANSLITERATION
36class TransliteratorParser;
37class NormalizationTransliterator;
38class TransliteratorIDParser;
529#ifndef U_HIDE_INTERNAL_API
542 inline static Token pointerToken(
void*);
601 friend class TransliteratorParser;
602 friend class TransliteratorIDParser;
603 friend class TransliteratorAlias;
921 virtual void filteredTransliterate(
Replaceable& text,
941 int32_t getMaximumContextLength()
const;
1276#ifndef U_HIDE_INTERNAL_API
1446#ifndef U_HIDE_INTERNAL_API
1536#ifndef U_HIDE_OBSOLETE_API
1562inline int32_t Transliterator::getMaximumContextLength()
const {
1563 return maximumContextLength;
1569 ID.
append(
static_cast<char16_t>(0));
1573#ifndef U_HIDE_INTERNAL_API
"Smart pointer" base class; do not use directly: use LocalPointer etc.
A Locale object represents a specific geographical, political, or cultural region.
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Base class for 'pure' C++ implementations of uenum api.
Transliterator is an abstract class that transliterates text from one format to another.
static Transliterator * createFromRules(const UnicodeString &ID, const UnicodeString &rules, UTransDirection dir, UParseError &parseError, UErrorCode &status)
Returns a Transliterator object constructed from the given rule string.
static UnicodeString & getAvailableVariant(int32_t index, const UnicodeString &source, const UnicodeString &target, UnicodeString &result)
Return a registered variant specifier for a given source-target pair.
virtual void transliterate(Replaceable &text) const
Transliterates an entire string in place.
const Transliterator & getElement(int32_t index, UErrorCode &ec) const
Return an element that makes up this transliterator.
void adoptFilter(UnicodeFilter *adoptedFilter)
Changes the filter used by this transliterator.
static UnicodeString & _getAvailableVariant(int32_t index, const UnicodeString &source, const UnicodeString &target, UnicodeString &result)
Non-mutexed internal method.
static void _registerAlias(const UnicodeString &aliasID, const UnicodeString &realID)
virtual UClassID getDynamicClassID() const override=0
Returns a unique class ID polymorphically.
static int32_t countAvailableIDs()
Return the number of IDs currently registered with the system.
static void unregister(const UnicodeString &ID)
Unregisters a transliterator or class.
static UnicodeString & getDisplayName(const UnicodeString &ID, UnicodeString &result)
Returns a name for this transliterator that is appropriate for display to the user in the default loc...
virtual const UnicodeString & getID() const
Returns a programmatic identifier for this transliterator.
virtual int32_t transliterate(Replaceable &text, int32_t start, int32_t limit) const
Transliterates a segment of a string, with optional filtering.
Transliterator & operator=(const Transliterator &)
Assignment operator.
virtual UnicodeSet & getTargetSet(UnicodeSet &result) const
Returns the set of all characters that may be generated as replacement text by this transliterator.
virtual void handleGetSourceSet(UnicodeSet &result) const
Framework method that returns the set of all characters that may be modified in the input text by thi...
static UnicodeString & getDisplayName(const UnicodeString &ID, const Locale &inLocale, UnicodeString &result)
Returns a name for this transliterator that is appropriate for display to the user in the given local...
Transliterator * createInverse(UErrorCode &status) const
Returns this transliterator's inverse.
UnicodeFilter * orphanFilter()
Returns the filter used by this transliterator, or nullptr if this transliterator uses no filter.
static UnicodeString & getAvailableSource(int32_t index, UnicodeString &result)
Return a registered source specifier.
static Transliterator * createInstance(const UnicodeString &ID, UTransDirection dir, UErrorCode &status)
Returns a Transliterator object given its ID.
virtual ~Transliterator()
Destructor.
static void registerAlias(const UnicodeString &aliasID, const UnicodeString &realID)
Registers an ID string as an alias of another ID string.
static UClassID getStaticClassID()
Return the class ID for this class.
static int32_t countAvailableVariants(const UnicodeString &source, const UnicodeString &target)
Return the number of registered variant specifiers for a given source-target pair.
static Transliterator * createBasicInstance(const UnicodeString &id, const UnicodeString *canon)
Create a transliterator from a basic ID.
virtual void transliterate(Replaceable &text, UTransPosition &index, UErrorCode &status) const
Transliterates the portion of the text buffer that can be transliterated unambiguosly.
static int32_t _countAvailableSources()
Non-mutexed internal method.
const UnicodeFilter * getFilter() const
Returns the filter used by this transliterator, or nullptr if this transliterator uses no filter.
virtual Transliterator * clone() const
Implements Cloneable.
virtual void handleTransliterate(Replaceable &text, UTransPosition &pos, UBool incremental) const =0
Abstract method that concrete subclasses define to implement their transliteration algorithm.
virtual void filteredTransliterate(Replaceable &text, UTransPosition &index, UBool incremental) const
Transliterate a substring of text, as specified by index, taking filters into account.
Transliterator *(* Factory)(const UnicodeString &ID, Token context)
A function that creates and returns a Transliterator.
static UnicodeString & _getAvailableTarget(int32_t index, const UnicodeString &source, UnicodeString &result)
Non-mutexed internal method.
static UnicodeString & getAvailableTarget(int32_t index, const UnicodeString &source, UnicodeString &result)
Return a registered target specifier for a given source.
static void _registerSpecialInverse(const UnicodeString &target, const UnicodeString &inverseTarget, UBool bidirectional)
Register two targets as being inverses of one another.
UnicodeSet & getSourceSet(UnicodeSet &result) const
Returns the set of all characters that may be modified in the input text by this Transliterator.
static int32_t _countAvailableTargets(const UnicodeString &source)
Non-mutexed internal method.
virtual UnicodeString & toRules(UnicodeString &result, UBool escapeUnprintable) const
Create a rule string that can be passed to createFromRules() to recreate this transliterator.
virtual void transliterate(Replaceable &text, UTransPosition &index, const UnicodeString &insertion, UErrorCode &status) const
Transliterates the portion of the text buffer that can be transliterated unambiguosly after new text ...
static int32_t countAvailableTargets(const UnicodeString &source)
Return the number of registered target specifiers for a given source specifier.
Transliterator(const UnicodeString &ID, UnicodeFilter *adoptedFilter)
Default constructor.
Transliterator(const Transliterator &)
Copy constructor.
static void registerFactory(const UnicodeString &id, Factory factory, Token context)
Registers a factory function that creates transliterators of a given ID.
static UnicodeString & _getAvailableSource(int32_t index, UnicodeString &result)
Non-mutexed internal method.
void setMaximumContextLength(int32_t maxContextLength)
Method for subclasses to use to set the maximum context length.
static const UnicodeString & getAvailableID(int32_t index)
Return the index-th available ID.
static Transliterator * createInstance(const UnicodeString &ID, UTransDirection dir, UParseError &parseError, UErrorCode &status)
Returns a Transliterator object given its ID.
static void _registerFactory(const UnicodeString &id, Factory factory, Token context)
static void registerInstance(Transliterator *adoptedObj)
Registers an instance obj of a subclass of Transliterator with the system.
int32_t countElements() const
Return the number of elements that make up this transliterator.
virtual void finishTransliteration(Replaceable &text, UTransPosition &index) const
Finishes any pending transliterations that were waiting for more characters.
static int32_t countAvailableSources()
Return the number of registered source specifiers.
virtual void transliterate(Replaceable &text, UTransPosition &index, UChar32 insertion, UErrorCode &status) const
Transliterates the portion of the text buffer that can be transliterated unambiguosly after a new cha...
static void _registerInstance(Transliterator *adoptedObj)
static StringEnumeration * getAvailableIDs(UErrorCode &ec)
Return a StringEnumeration over the IDs available at the time of the call, including user-registered ...
static int32_t _countAvailableVariants(const UnicodeString &source, const UnicodeString &target)
Non-mutexed internal method.
UObject is the common ICU "boilerplate" class.
UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Uni...
A mutable set of Unicode characters and multicharacter strings.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UBool truncate(int32_t targetLength)
Truncate this UnicodeString to the targetLength.
UnicodeString & append(const UnicodeString &srcText, int32_t srcStart, int32_t srcLength)
Append the characters in srcText in the range [srcStart, srcStart + srcLength) to the UnicodeString o...
C API: Parse Error Information.
C++ API: String Enumeration.
A UParseError struct is used to returned detailed information about parsing errors.
Position structure for utrans_transIncremental() incremental transliteration.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int8_t UBool
The ICU boolean type, a signed-byte integer.
A context integer or pointer for a factory function, passed by value.
void * pointer
This token, interpreted as a native pointer.
int32_t integer
This token, interpreted as a 32-bit integer.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
UTransDirection
Direction constant indicating the direction in a transliterator, e.g., the forward or reverse rules o...
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.