intl/icu/source/i18n/nortrans.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2 **********************************************************************
     3 *   Copyright (C) 2001-2010, International Business Machines
     4 *   Corporation and others.  All Rights Reserved.
     5 **********************************************************************
     6 *   Date        Name        Description
     7 *   07/03/01    aliu        Creation.
     8 **********************************************************************
     9 */
    10 #ifndef NORTRANS_H
    11 #define NORTRANS_H
    13 #include "unicode/utypes.h"
    15 #if !UCONFIG_NO_TRANSLITERATION
    17 #include "unicode/translit.h"
    18 #include "unicode/normalizer2.h"
    20 U_NAMESPACE_BEGIN
    22 /**
    23  * A transliterator that performs normalization.
    24  * @author Alan Liu
    25  */
    26 class NormalizationTransliterator : public Transliterator {
    27     const Normalizer2 &fNorm2;
    29  public:
    31     /**
    32      * Destructor.
    33      */
    34     virtual ~NormalizationTransliterator();
    36     /**
    37      * Copy constructor.
    38      */
    39     NormalizationTransliterator(const NormalizationTransliterator&);
    41     /**
    42      * Transliterator API.
    43      * @return    A copy of the object.
    44      */
    45     virtual Transliterator* clone(void) const;
    47     /**
    48      * ICU "poor man's RTTI", returns a UClassID for the actual class.
    49      */
    50     virtual UClassID getDynamicClassID() const;
    52     /**
    53      * ICU "poor man's RTTI", returns a UClassID for this class.
    54      */
    55     U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
    57  protected:
    59     /**
    60      * Implements {@link Transliterator#handleTransliterate}.
    61      * @param text          the buffer holding transliterated and
    62      *                      untransliterated text
    63      * @param offset        the start and limit of the text, the position
    64      *                      of the cursor, and the start and limit of transliteration.
    65      * @param incremental   if true, assume more text may be coming after
    66      *                      pos.contextLimit. Otherwise, assume the text is complete.
    67      */
    68     virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
    69                              UBool isIncremental) const;
    70  public:
    72     /**
    73      * System registration hook.  Public to Transliterator only.
    74      */
    75     static void registerIDs();
    77  private:
    79     // Transliterator::Factory methods
    80     static Transliterator* _create(const UnicodeString& ID,
    81                                    Token context);
    83     /**
    84      * Constructs a transliterator.  This method is private.
    85      * Public users must use the factory method createInstance().
    86      */
    87     NormalizationTransliterator(const UnicodeString& id, const Normalizer2 &norm2);
    89 private:
    90     /**
    91      * Assignment operator.
    92      */
    93     NormalizationTransliterator& operator=(const NormalizationTransliterator&);
    94 };
    96 U_NAMESPACE_END
    98 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
   100 #endif

mercurial