#include <unitohex.h>
Inheritance diagram for UnicodeToHexTransliterator:
Public Member Functions | |
UnicodeToHexTransliterator (const UnicodeString &pattern, UBool isUppercase, UnicodeFilter *adoptedFilter, UErrorCode &status) | |
Constructs a transliterator. | |
UnicodeToHexTransliterator (const UnicodeString &pattern, UErrorCode &status) | |
Constructs an uppercase transliterator with no filter. | |
UnicodeToHexTransliterator (UnicodeFilter *adoptedFilter=0) | |
Constructs a transliterator with the default prefix "\u" that outputs uppercase hex digits. | |
virtual | ~UnicodeToHexTransliterator () |
Destructor. | |
UnicodeToHexTransliterator (const UnicodeToHexTransliterator &) | |
Copy constructor. | |
UnicodeToHexTransliterator & | operator= (const UnicodeToHexTransliterator &) |
Assignment operator. | |
virtual Transliterator * | clone (void) const |
Transliterator API. | |
void | applyPattern (const UnicodeString &thePattern, UErrorCode &status) |
Set the pattern recognized by this transliterator. | |
const UnicodeString & | toPattern (void) const |
Return this transliterator's pattern. | |
virtual UBool | isUppercase (void) const |
Returns true if this transliterator outputs uppercase hex digits. | |
virtual void | setUppercase (UBool outputUppercase) |
Sets if this transliterator outputs uppercase hex digits. | |
virtual void | handleTransliterate (Replaceable &text, UTransPosition &offsets, UBool isIncremental) const |
Implements Transliterator#handleTransliterate. |
It outputs a prefix specified in the constructor and optionally converts the hex digits to uppercase.
The format of the output is set by a pattern. This pattern follows the same syntax as HexToUnicodeTransliterator
, except it does not allow multiple specifications. The pattern sets the prefix string, suffix string, and minimum and maximum digit count. There are no setters or getters for these attributes; they are set only through the pattern.
The setUppercase() and isUppercase() methods control whether 'a' through 'f' or 'A' through 'F' are output as hex digits. This is not controlled through the pattern; only through the methods. The default is uppercase.
|
Constructs a transliterator.
|
|
Constructs an uppercase transliterator with no filter.
|
|
Constructs a transliterator with the default prefix "\u" that outputs uppercase hex digits.
|
|
Destructor.
|
|
Copy constructor.
|
|
Set the pattern recognized by this transliterator. The pattern must contain zero or more prefix characters, one or more digit characters, and zero or more suffix characters. The digit characters indicates optional digits ('#') followed by required digits ('0'). The total number of digits cannot exceed 4, and must be at least 1 required digit. Use a backslash ('\') to escape any of the special characters. An empty pattern is not allowed. Example: "U+0000" specifies a prefix of "U+", exactly four digits, and no suffix. "<###0>" has a prefix of "<", between one and four digits, and a suffix of ">".
pattern := prefix-char* digit-spec suffix-char* digit-spec := '#'* '0'+ prefix-char := [^special-char] | '\' special-char suffix-char := [^special-char] | '\' special-char special-char := ';' | '0' | '#' | '\' Limitations: There is no way to set the uppercase attribute in the pattern. (applyPattern() does not alter the uppercase attribute.)
|
|
Transliterator API.
Reimplemented from Transliterator. |
|
Implements Transliterator#handleTransliterate.
Implements Transliterator. |
|
Returns true if this transliterator outputs uppercase hex digits.
|
|
Assignment operator.
|
|
Sets if this transliterator outputs uppercase hex digits.
|
|
Return this transliterator's pattern.
|