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