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