intl/icu/source/i18n/nortrans.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/nortrans.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,100 @@
     1.4 +/*
     1.5 +**********************************************************************
     1.6 +*   Copyright (C) 2001-2010, International Business Machines
     1.7 +*   Corporation and others.  All Rights Reserved.
     1.8 +**********************************************************************
     1.9 +*   Date        Name        Description
    1.10 +*   07/03/01    aliu        Creation.
    1.11 +**********************************************************************
    1.12 +*/
    1.13 +#ifndef NORTRANS_H
    1.14 +#define NORTRANS_H
    1.15 +
    1.16 +#include "unicode/utypes.h"
    1.17 +
    1.18 +#if !UCONFIG_NO_TRANSLITERATION
    1.19 +
    1.20 +#include "unicode/translit.h"
    1.21 +#include "unicode/normalizer2.h"
    1.22 +
    1.23 +U_NAMESPACE_BEGIN
    1.24 +
    1.25 +/**
    1.26 + * A transliterator that performs normalization.
    1.27 + * @author Alan Liu
    1.28 + */
    1.29 +class NormalizationTransliterator : public Transliterator {
    1.30 +    const Normalizer2 &fNorm2;
    1.31 +
    1.32 + public:
    1.33 +
    1.34 +    /**
    1.35 +     * Destructor.
    1.36 +     */
    1.37 +    virtual ~NormalizationTransliterator();
    1.38 +
    1.39 +    /**
    1.40 +     * Copy constructor.
    1.41 +     */
    1.42 +    NormalizationTransliterator(const NormalizationTransliterator&);
    1.43 +
    1.44 +    /**
    1.45 +     * Transliterator API.
    1.46 +     * @return    A copy of the object.
    1.47 +     */
    1.48 +    virtual Transliterator* clone(void) const;
    1.49 +
    1.50 +    /**
    1.51 +     * ICU "poor man's RTTI", returns a UClassID for the actual class.
    1.52 +     */
    1.53 +    virtual UClassID getDynamicClassID() const;
    1.54 +
    1.55 +    /**
    1.56 +     * ICU "poor man's RTTI", returns a UClassID for this class.
    1.57 +     */
    1.58 +    U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
    1.59 +
    1.60 + protected:
    1.61 +
    1.62 +    /**
    1.63 +     * Implements {@link Transliterator#handleTransliterate}.
    1.64 +     * @param text          the buffer holding transliterated and
    1.65 +     *                      untransliterated text
    1.66 +     * @param offset        the start and limit of the text, the position
    1.67 +     *                      of the cursor, and the start and limit of transliteration.
    1.68 +     * @param incremental   if true, assume more text may be coming after
    1.69 +     *                      pos.contextLimit. Otherwise, assume the text is complete.
    1.70 +     */
    1.71 +    virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
    1.72 +                             UBool isIncremental) const;
    1.73 + public:
    1.74 +
    1.75 +    /**
    1.76 +     * System registration hook.  Public to Transliterator only.
    1.77 +     */
    1.78 +    static void registerIDs();
    1.79 +
    1.80 + private:
    1.81 +
    1.82 +    // Transliterator::Factory methods
    1.83 +    static Transliterator* _create(const UnicodeString& ID,
    1.84 +                                   Token context);
    1.85 +
    1.86 +    /**
    1.87 +     * Constructs a transliterator.  This method is private.
    1.88 +     * Public users must use the factory method createInstance().
    1.89 +     */
    1.90 +    NormalizationTransliterator(const UnicodeString& id, const Normalizer2 &norm2);
    1.91 +
    1.92 +private:
    1.93 +    /**
    1.94 +     * Assignment operator.
    1.95 +     */
    1.96 +    NormalizationTransliterator& operator=(const NormalizationTransliterator&);
    1.97 +};
    1.98 +
    1.99 +U_NAMESPACE_END
   1.100 +
   1.101 +#endif /* #if !UCONFIG_NO_TRANSLITERATION */
   1.102 +
   1.103 +#endif

mercurial