]>
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/06/01 aliu Creation. | |
8 | ********************************************************************** | |
9 | */ | |
10 | #ifndef UNI2NAME_H | |
11 | #define UNI2NAME_H | |
12 | ||
13 | #include "unicode/utypes.h" | |
14 | ||
15 | #if !UCONFIG_NO_TRANSLITERATION | |
16 | ||
17 | #include "unicode/translit.h" | |
18 | ||
19 | U_NAMESPACE_BEGIN | |
20 | ||
21 | /** | |
22 | * A transliterator that performs character to name mapping. | |
23 | * It generates the Perl syntax \N{name}. | |
24 | * @author Alan Liu | |
25 | */ | |
26 | class U_I18N_API UnicodeNameTransliterator : public Transliterator { | |
27 | ||
28 | public: | |
29 | ||
30 | /** | |
31 | * Constructs a transliterator. | |
32 | * @param adoptedFilter the filter to be adopted. | |
33 | */ | |
34 | UnicodeNameTransliterator(UnicodeFilter* adoptedFilter = 0); | |
35 | ||
36 | /** | |
37 | * Destructor. | |
38 | */ | |
39 | virtual ~UnicodeNameTransliterator(); | |
40 | ||
41 | /** | |
42 | * Copy constructor. | |
43 | */ | |
44 | UnicodeNameTransliterator(const UnicodeNameTransliterator&); | |
45 | ||
46 | /** | |
47 | * Assignment operator. | |
48 | */ | |
49 | UnicodeNameTransliterator& operator=(const UnicodeNameTransliterator&); | |
50 | ||
51 | /** | |
52 | * Transliterator API. | |
53 | */ | |
374ca955 | 54 | virtual Transliterator* clone(void) const; |
b75a7d8f A |
55 | |
56 | /** | |
57 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
58 | * | |
59 | * @draft ICU 2.2 | |
60 | */ | |
374ca955 | 61 | virtual UClassID getDynamicClassID() const; |
b75a7d8f A |
62 | |
63 | /** | |
64 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
65 | * | |
66 | * @draft ICU 2.2 | |
67 | */ | |
374ca955 | 68 | static UClassID U_EXPORT2 getStaticClassID(); |
b75a7d8f A |
69 | |
70 | protected: | |
71 | ||
72 | /** | |
73 | * Implements {@link Transliterator#handleTransliterate}. | |
74 | * @param text the buffer holding transliterated and | |
75 | * untransliterated text | |
76 | * @param offset the start and limit of the text, the position | |
77 | * of the cursor, and the start and limit of transliteration. | |
78 | * @param incremental if true, assume more text may be coming after | |
79 | * pos.contextLimit. Otherwise, assume the text is complete. | |
80 | */ | |
81 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, | |
82 | UBool isIncremental) const; | |
83 | ||
b75a7d8f A |
84 | }; |
85 | ||
86 | U_NAMESPACE_END | |
87 | ||
88 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | |
89 | ||
90 | #endif |