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

mercurial