2
**********************************************************************
3
* Copyright (C) 1999-2002, International Business Machines
4
* Corporation and others. All Rights Reserved.
5
**********************************************************************
6
* Date Name Description
7
* 11/17/99 aliu Creation.
8
**********************************************************************
13
#include "unicode/translit.h"
18
* A transliterator that converts from hexadecimal Unicode escape
19
* sequences to the characters they represent. For example, "U+0040"
20
* and '\u0040'. A default HexToUnicodeTransliterator recognizes the
21
* prefixes "U+", "u+", "\U", and "\u". Hex values may be
22
* upper- or lowercase. By calling the applyPattern() method, one
23
* or more custom prefix/suffix pairs may be specified. See
24
* applyPattern() for details.
26
* <p>Copyright © IBM Corporation 1999. All rights reserved.
29
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
31
class U_I18N_API HexToUnicodeTransliterator : public Transliterator {
34
* ID for this transliterator.
36
static const char _ID[];
39
* The pattern used by the default constructor
41
static const UChar DEFAULT_PATTERN[];
43
// Character constants defined here to avoid ASCII dependency
45
SEMICOLON = 0x003B, // ';'
47
POUND = 0x0023, // '#'
48
BACKSLASH = 0x005C // '\\'
52
* The pattern for this transliterator
54
UnicodeString pattern;
57
* The processed pattern specification. See applyPattern() for
60
UnicodeString affixes;
63
* The number of different affix sets in affixes.
70
* Constructs a transliterator that recognizes the standard
71
* prefixes "\u", "\U", "u+", and "U+", each with no
73
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
75
HexToUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0);
78
* Constructs a custom transliterator with the given pattern.
80
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
82
HexToUnicodeTransliterator(const UnicodeString& pattern,
86
* Constructs a custom transliterator with the given pattern
89
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
91
HexToUnicodeTransliterator(const UnicodeString& pattern,
92
UnicodeFilter* adoptedFilter,
97
* @deprecated To be removed after 2002-sep-30, use Transliterator dtor directly.
99
virtual ~HexToUnicodeTransliterator();
103
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method
105
HexToUnicodeTransliterator(const HexToUnicodeTransliterator&);
108
* Assignment operator.
109
* @deprecated To be removed after 2002-sep-30.
111
HexToUnicodeTransliterator& operator=(const HexToUnicodeTransliterator&);
114
* Transliterator API.
115
* @deprecated To be removed after 2002-sep-30.
117
Transliterator* clone(void) const;
120
* Set the patterns recognized by this transliterator. One or
121
* more patterns may be specified, separated by semicolons (';').
122
* Each pattern contains zero or more prefix characters, one or
123
* more digit characters, and zero or more suffix characters. The
124
* digit characters indicates optional digits ('#') followed by
125
* required digits ('0'). The total number of digits cannot
126
* exceed 4, and must be at least 1 required digit. Use a
127
* backslash ('\\') to escape any of the special characters. An
128
* empty pattern is allowed; it specifies a transliterator that
131
* <p>Example: "U+0000;<###0>" specifies two patterns. The first
132
* has a prefix of "U+", exactly four digits, and no suffix. The
133
* second has a prefix of "<", between one and four digits, and a
137
* pattern := spec | ( pattern ';' spec )
138
* spec := prefix-char* digit-spec suffix-char*
139
* digit-spec := '#'* '0'+
140
* prefix-char := [^special-char] | '\\' special-char
141
* suffix-char := [^special-char] | '\\' special-char
142
* special-char := ';' | '0' | '#' | '\\'
144
* @deprecated To be removed after 2002-sep-30.
146
void applyPattern(const UnicodeString& thePattern, UErrorCode& status);
149
* Return this transliterator's pattern.
150
* @deprecated To be removed after 2002-sep-30.
152
const UnicodeString& toPattern(void) const;
155
* Implements {@link Transliterator#handleTransliterate}.
156
* @deprecated To be removed after 2002-sep-30.
158
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
159
UBool isIncremental) const;
162
inline HexToUnicodeTransliterator::~HexToUnicodeTransliterator() {}