Logo Search packages:      
Sourcecode: icu version File versions

EscapeTransliterator Class Reference

#include <esctrn.h>

Inheritance diagram for EscapeTransliterator:

Transliterator UObject UMemory

List of all members.

Detailed Description

A transliterator that converts Unicode characters to an escape form. Examples of escape forms are "U+4E01" and "&#x10FFFF;". Escape forms have a prefix and suffix, either of which may be empty, a radix, typically 16 or 10, a minimum digit count, typically 1, 4, or 8, and a boolean that specifies whether supplemental characters are handled as 32-bit code points or as two 16-bit code units. Most escape forms handle 32-bit code points, but some, such as the Java form, intentionally break them into two surrogate pairs, for backward compatibility.

Some escape forms actually have two different patterns, one for BMP characters (0..FFFF) and one for supplements (>FFFF). To handle this, a second EscapeTransliterator may be defined that specifies the pattern to be produced for supplementals. An example of a form that requires this is the C form, which uses "\\uFFFF" for BMP characters and "\\U0010FFFF" for supplementals.

This class is package private. It registers several standard variants with the system which are then accessed via their IDs.

Alan Liu

Definition at line 44 of file esctrn.h.

Public Types

typedef Transliterator
*(U_EXPORT2 * 
Factory )(const UnicodeString &ID, Token context)

Public Member Functions

void adoptFilter (UnicodeFilter *adoptedFilter)
virtual Transliteratorclone () const
int32_t countElements () const
TransliteratorcreateInverse (UErrorCode &status) const
 EscapeTransliterator (const EscapeTransliterator &)
 EscapeTransliterator (const UnicodeString &ID, const UnicodeString &prefix, const UnicodeString &suffix, int32_t radix, int32_t minDigits, UBool grokSupplementals, EscapeTransliterator *adoptedSupplementalHandler)
virtual void filteredTransliterate (Replaceable &text, UTransPosition &index, UBool incremental) const
virtual void finishTransliteration (Replaceable &text, UTransPosition &index) const
virtual UClassID getDynamicClassID () const
const TransliteratorgetElement (int32_t index, UErrorCode &ec) const
const UnicodeFiltergetFilter (void) const
virtual const UnicodeStringgetID (void) const
int32_t getMaximumContextLength (void) const
UnicodeSetgetSourceSet (UnicodeSet &result) const
virtual UnicodeSetgetTargetSet (UnicodeSet &result) const
virtual void handleGetSourceSet (UnicodeSet &result) const
UnicodeFilterorphanFilter (void)
virtual UnicodeStringtoRules (UnicodeString &result, UBool escapeUnprintable) const
virtual void transliterate (Replaceable &text, UTransPosition &index, UErrorCode &status) const
virtual void transliterate (Replaceable &text, UTransPosition &index, UChar32 insertion, UErrorCode &status) const
virtual void transliterate (Replaceable &text, UTransPosition &index, const UnicodeString &insertion, UErrorCode &status) const
virtual void transliterate (Replaceable &text) const
virtual int32_t transliterate (Replaceable &text, int32_t start, int32_t limit) const
virtual ~EscapeTransliterator ()

Static Public Member Functions

static int32_t U_EXPORT2 countAvailableIDs (void)
static int32_t U_EXPORT2 countAvailableSources (void)
static int32_t U_EXPORT2 countAvailableTargets (const UnicodeString &source)
static int32_t U_EXPORT2 countAvailableVariants (const UnicodeString &source, const UnicodeString &target)
static Transliterator *U_EXPORT2 createFromRules (const UnicodeString &ID, const UnicodeString &rules, UTransDirection dir, UParseError &parseError, UErrorCode &status)
static Transliterator *U_EXPORT2 createInstance (const UnicodeString &ID, UTransDirection dir, UErrorCode &status)
static Transliterator *U_EXPORT2 createInstance (const UnicodeString &ID, UTransDirection dir, UParseError &parseError, UErrorCode &status)
static const UnicodeString
getAvailableID (int32_t index)
static StringEnumeration *U_EXPORT2 getAvailableIDs (UErrorCode &ec)
static UnicodeString &U_EXPORT2 getAvailableSource (int32_t index, UnicodeString &result)
static UnicodeString &U_EXPORT2 getAvailableTarget (int32_t index, const UnicodeString &source, UnicodeString &result)
static UnicodeString &U_EXPORT2 getAvailableVariant (int32_t index, const UnicodeString &source, const UnicodeString &target, UnicodeString &result)
static UnicodeString &U_EXPORT2 getDisplayName (const UnicodeString &ID, const Locale &inLocale, UnicodeString &result)
static UnicodeString &U_EXPORT2 getDisplayName (const UnicodeString &ID, UnicodeString &result)
static U_I18N_API UClassID
getStaticClassID ()
static Token integerToken (int32_t)
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW
static Token pointerToken (void *)
static void U_EXPORT2 registerAlias (const UnicodeString &aliasID, const UnicodeString &realID)
static void U_EXPORT2 registerFactory (const UnicodeString &id, Factory factory, Token context)
static void registerIDs ()
static void U_EXPORT2 registerInstance (Transliterator *adoptedObj)
static void U_EXPORT2 unregister (const UnicodeString &ID)

Protected Member Functions

virtual void handleTransliterate (Replaceable &text, UTransPosition &offset, UBool isIncremental) const
void setID (const UnicodeString &id)
void setMaximumContextLength (int32_t maxContextLength)

Static Protected Member Functions

static int32_t _countAvailableSources (void)
static int32_t _countAvailableTargets (const UnicodeString &source)
static int32_t _countAvailableVariants (const UnicodeString &source, const UnicodeString &target)
static UnicodeString_getAvailableSource (int32_t index, UnicodeString &result)
static UnicodeString_getAvailableTarget (int32_t index, const UnicodeString &source, UnicodeString &result)
static UnicodeString_getAvailableVariant (int32_t index, const UnicodeString &source, const UnicodeString &target, UnicodeString &result)
static void _registerAlias (const UnicodeString &aliasID, const UnicodeString &realID)
static void _registerFactory (const UnicodeString &id, Factory factory, Token context)
static void _registerInstance (Transliterator *adoptedObj)
static void _registerSpecialInverse (const UnicodeString &target, const UnicodeString &inverseTarget, UBool bidirectional)
static TransliteratorcreateBasicInstance (const UnicodeString &id, const UnicodeString *canon)

Private Attributes

UBool grokSupplementals
int32_t minDigits
UnicodeString prefix
int32_t radix
UnicodeString suffix


class TransliteratorAlias
class TransliteratorIDParser
class TransliteratorParser

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index