]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/tolowtrn.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / i18n / tolowtrn.h
1 /*
2 **********************************************************************
3 * Copyright (C) 2001, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Date Name Description
7 * 05/24/01 aliu Creation.
8 **********************************************************************
9 */
10 #ifndef TOLOWTRN_H
11 #define TOLOWTRN_H
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_TRANSLITERATION
16
17 #include "unicode/translit.h"
18 #include "unicode/locid.h"
19
20 U_NAMESPACE_BEGIN
21
22 /**
23 * A transliterator that performs locale-sensitive toLower()
24 * case mapping.
25 * @author Alan Liu
26 */
27 class U_I18N_API LowercaseTransliterator : public Transliterator {
28
29 public:
30
31 /**
32 * Constructs a transliterator.
33 * @param loc the given locale.
34 */
35 LowercaseTransliterator(const Locale& loc = Locale::getDefault());
36
37 /**
38 * Destructor.
39 */
40 virtual ~LowercaseTransliterator();
41
42 /**
43 * Copy constructor.
44 */
45 LowercaseTransliterator(const LowercaseTransliterator&);
46
47 /**
48 * Assignment operator.
49 */
50 LowercaseTransliterator& operator=(const LowercaseTransliterator&);
51
52 /**
53 * Transliterator API.
54 * @return a copy of the object.
55 */
56 Transliterator* clone(void) const;
57
58 /**
59 * ICU "poor man's RTTI", returns a UClassID for the actual class.
60 *
61 * @draft ICU 2.2
62 */
63 virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
64
65 /**
66 * ICU "poor man's RTTI", returns a UClassID for this class.
67 *
68 * @draft ICU 2.2
69 */
70 static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
71
72 protected:
73
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 private:
88
89 Locale loc;
90 UChar* buffer;
91 static const char _ID[];
92
93 /**
94 * The address of this static class variable serves as this class's ID
95 * for ICU "poor man's RTTI".
96 */
97 static const char fgClassID;
98 };
99
100 U_NAMESPACE_END
101
102 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
103
104 #endif