]>
Commit | Line | Data |
---|---|---|
1 | // © 2016 and later: Unicode, Inc. and others. | |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
3 | /* | |
4 | ******************************************************************************* | |
5 | * | |
6 | * Copyright (C) 2001-2008, International Business Machines | |
7 | * Corporation and others. All Rights Reserved. | |
8 | * | |
9 | ******************************************************************************* | |
10 | * file name: casetrn.h | |
11 | * encoding: UTF-8 | |
12 | * tab size: 8 (not used) | |
13 | * indentation:4 | |
14 | * | |
15 | * created on: 2004sep03 | |
16 | * created by: Markus W. Scherer | |
17 | * | |
18 | * Implementation class for lower-/upper-/title-casing transliterators. | |
19 | */ | |
20 | ||
21 | #ifndef __CASETRN_H__ | |
22 | #define __CASETRN_H__ | |
23 | ||
24 | #include "unicode/utypes.h" | |
25 | ||
26 | #if !UCONFIG_NO_TRANSLITERATION | |
27 | ||
28 | #include "unicode/translit.h" | |
29 | #include "ucase.h" | |
30 | ||
31 | U_NAMESPACE_BEGIN | |
32 | ||
33 | /** | |
34 | * A transliterator that performs locale-sensitive | |
35 | * case mapping. | |
36 | */ | |
37 | class CaseMapTransliterator : public Transliterator { | |
38 | public: | |
39 | /** | |
40 | * Constructs a transliterator. | |
41 | * @param loc the given locale. | |
42 | * @param id the transliterator ID. | |
43 | * @param map the full case mapping function (see ucase.h) | |
44 | */ | |
45 | CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map); | |
46 | ||
47 | /** | |
48 | * Destructor. | |
49 | */ | |
50 | virtual ~CaseMapTransliterator(); | |
51 | ||
52 | /** | |
53 | * Copy constructor. | |
54 | */ | |
55 | CaseMapTransliterator(const CaseMapTransliterator&); | |
56 | ||
57 | /** | |
58 | * Transliterator API. | |
59 | * @return a copy of the object. | |
60 | */ | |
61 | virtual Transliterator* clone(void) const = 0; | |
62 | ||
63 | /** | |
64 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
65 | */ | |
66 | //virtual UClassID getDynamicClassID() const; | |
67 | ||
68 | /** | |
69 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
70 | */ | |
71 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); | |
72 | ||
73 | protected: | |
74 | /** | |
75 | * Implements {@link Transliterator#handleTransliterate}. | |
76 | * @param text the buffer holding transliterated and | |
77 | * untransliterated text | |
78 | * @param offset the start and limit of the text, the position | |
79 | * of the cursor, and the start and limit of transliteration. | |
80 | * @param incremental if true, assume more text may be coming after | |
81 | * pos.contextLimit. Otherwise, assume the text is complete. | |
82 | */ | |
83 | virtual void handleTransliterate(Replaceable& text, | |
84 | UTransPosition& offsets, | |
85 | UBool isIncremental) const; | |
86 | ||
87 | UCaseMapFull *fMap; | |
88 | ||
89 | private: | |
90 | /** | |
91 | * Assignment operator. | |
92 | */ | |
93 | CaseMapTransliterator& operator=(const CaseMapTransliterator&); | |
94 | ||
95 | }; | |
96 | ||
97 | U_NAMESPACE_END | |
98 | ||
99 | /** case context iterator using a Replaceable. This must be a C function because it is a callback. */ | |
100 | U_CFUNC UChar32 U_CALLCONV | |
101 | utrans_rep_caseContextIterator(void *context, int8_t dir); | |
102 | ||
103 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | |
104 | ||
105 | #endif |