intl/icu/source/i18n/casetrn.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/casetrn.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,104 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +*
     1.7 +*   Copyright (C) 2001-2008, International Business Machines
     1.8 +*   Corporation and others.  All Rights Reserved.
     1.9 +*
    1.10 +*******************************************************************************
    1.11 +*   file name:  casetrn.h
    1.12 +*   encoding:   US-ASCII
    1.13 +*   tab size:   8 (not used)
    1.14 +*   indentation:4
    1.15 +*
    1.16 +*   created on: 2004sep03
    1.17 +*   created by: Markus W. Scherer
    1.18 +*
    1.19 +*   Implementation class for lower-/upper-/title-casing transliterators.
    1.20 +*/
    1.21 +
    1.22 +#ifndef __CASETRN_H__
    1.23 +#define __CASETRN_H__
    1.24 +
    1.25 +#include "unicode/utypes.h"
    1.26 +
    1.27 +#if !UCONFIG_NO_TRANSLITERATION
    1.28 +
    1.29 +#include "unicode/translit.h"
    1.30 +#include "ucase.h"
    1.31 +
    1.32 +U_NAMESPACE_BEGIN
    1.33 +
    1.34 +/**
    1.35 + * A transliterator that performs locale-sensitive
    1.36 + * case mapping.
    1.37 + */
    1.38 +class CaseMapTransliterator : public Transliterator {
    1.39 +public:
    1.40 +    /**
    1.41 +     * Constructs a transliterator.
    1.42 +     * @param loc the given locale.
    1.43 +     * @param id  the transliterator ID.
    1.44 +     * @param map the full case mapping function (see ucase.h)
    1.45 +     */
    1.46 +    CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map);
    1.47 +
    1.48 +    /**
    1.49 +     * Destructor.
    1.50 +     */
    1.51 +    virtual ~CaseMapTransliterator();
    1.52 +
    1.53 +    /**
    1.54 +     * Copy constructor.
    1.55 +     */
    1.56 +    CaseMapTransliterator(const CaseMapTransliterator&);
    1.57 +
    1.58 +    /**
    1.59 +     * Transliterator API.
    1.60 +     * @return a copy of the object.
    1.61 +     */
    1.62 +    virtual Transliterator* clone(void) const = 0;
    1.63 +
    1.64 +    /**
    1.65 +     * ICU "poor man's RTTI", returns a UClassID for the actual class.
    1.66 +     */
    1.67 +    //virtual UClassID getDynamicClassID() const;
    1.68 +
    1.69 +    /**
    1.70 +     * ICU "poor man's RTTI", returns a UClassID for this class.
    1.71 +     */
    1.72 +    U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
    1.73 +
    1.74 +protected:
    1.75 +    /**
    1.76 +     * Implements {@link Transliterator#handleTransliterate}.
    1.77 +     * @param text        the buffer holding transliterated and
    1.78 +     *                    untransliterated text
    1.79 +     * @param offset      the start and limit of the text, the position
    1.80 +     *                    of the cursor, and the start and limit of transliteration.
    1.81 +     * @param incremental if true, assume more text may be coming after
    1.82 +     *                    pos.contextLimit.  Otherwise, assume the text is complete.
    1.83 +     */
    1.84 +    virtual void handleTransliterate(Replaceable& text,
    1.85 +                                     UTransPosition& offsets, 
    1.86 +                                     UBool isIncremental) const;
    1.87 +
    1.88 +    const UCaseProps *fCsp;
    1.89 +    UCaseMapFull *fMap;
    1.90 +
    1.91 +private:
    1.92 +    /**
    1.93 +     * Assignment operator.
    1.94 +     */
    1.95 +    CaseMapTransliterator& operator=(const CaseMapTransliterator&);
    1.96 +
    1.97 +};
    1.98 +
    1.99 +U_NAMESPACE_END
   1.100 +
   1.101 +/** case context iterator using a Replaceable. This must be a C function because it is a callback. */
   1.102 +U_CFUNC UChar32 U_CALLCONV
   1.103 +utrans_rep_caseContextIterator(void *context, int8_t dir);
   1.104 +
   1.105 +#endif /* #if !UCONFIG_NO_TRANSLITERATION */
   1.106 +
   1.107 +#endif

mercurial