]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ********************************************************************** | |
374ca955 | 3 | * Copyright (C) 2001-2004, International Business Machines |
b75a7d8f A |
4 | * Corporation and others. All Rights Reserved. |
5 | ********************************************************************** | |
6 | * Date Name Description | |
7 | * 06/07/01 aliu Creation. | |
8 | ********************************************************************** | |
9 | */ | |
10 | #ifndef NAME2UNI_H | |
11 | #define NAME2UNI_H | |
12 | ||
13 | #include "unicode/utypes.h" | |
14 | ||
15 | #if !UCONFIG_NO_TRANSLITERATION | |
16 | ||
17 | #include "unicode/translit.h" | |
374ca955 | 18 | #include "unicode/uniset.h" |
b75a7d8f A |
19 | |
20 | U_NAMESPACE_BEGIN | |
21 | ||
22 | /** | |
23 | * A transliterator that performs name to character mapping. | |
24 | * It recognizes the Perl syntax \N{name}. | |
25 | * @author Alan Liu | |
26 | */ | |
27 | class U_I18N_API NameUnicodeTransliterator : public Transliterator { | |
374ca955 | 28 | public: |
b75a7d8f A |
29 | |
30 | /** | |
31 | * Constructs a transliterator. | |
32 | * @param adoptedFilter the filter for this transliterator. | |
33 | */ | |
34 | NameUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0); | |
35 | ||
36 | /** | |
37 | * Destructor. | |
38 | */ | |
39 | virtual ~NameUnicodeTransliterator(); | |
40 | ||
41 | /** | |
42 | * Copy constructor. | |
43 | */ | |
44 | NameUnicodeTransliterator(const NameUnicodeTransliterator&); | |
45 | ||
46 | /** | |
47 | * Assignment operator. | |
48 | */ | |
49 | NameUnicodeTransliterator& operator=(const NameUnicodeTransliterator&); | |
50 | ||
51 | /** | |
52 | * Transliterator API. | |
53 | * @return A copy of the object. | |
54 | */ | |
374ca955 | 55 | virtual Transliterator* clone(void) const; |
b75a7d8f A |
56 | |
57 | /** | |
58 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
59 | * | |
60 | * @draft ICU 2.2 | |
61 | */ | |
374ca955 | 62 | virtual UClassID getDynamicClassID() const; |
b75a7d8f A |
63 | |
64 | /** | |
65 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
66 | * | |
67 | * @draft ICU 2.2 | |
68 | */ | |
374ca955 | 69 | static UClassID U_EXPORT2 getStaticClassID(); |
b75a7d8f A |
70 | |
71 | protected: | |
72 | ||
73 | /** | |
74 | * Implements {@link Transliterator#handleTransliterate}. | |
75 | * @param text the buffer holding transliterated and | |
76 | * untransliterated text | |
77 | * @param offset the start and limit of the text, the position | |
78 | * of the cursor, and the start and limit of transliteration. | |
79 | * @param incremental if true, assume more text may be coming after | |
80 | * pos.contextLimit. Otherwise, assume the text is complete. | |
81 | */ | |
82 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, | |
83 | UBool isIncremental) const; | |
84 | ||
374ca955 A |
85 | /** |
86 | * Set of characters which occur in Unicode character names. | |
87 | */ | |
88 | UnicodeSet legal; | |
b75a7d8f A |
89 | }; |
90 | ||
91 | U_NAMESPACE_END | |
92 | ||
93 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | |
94 | ||
95 | #endif |