]>
git.saurik.com Git - apple/icu.git/blob - icuSources/samples/translit/unaccent.h
1 /***********************************************************************
2 * © 2016 and later: Unicode, Inc. and others.
3 * License & terms of use: http://www.unicode.org/copyright.html#License
4 ***********************************************************************
5 ***********************************************************************
7 * Copyright (c) 1999-2003, International Business Machines Corporation and
8 * others. All Rights Reserved.
9 ***********************************************************************/
11 #include "unicode/translit.h"
12 #include "unicode/normlzr.h"
14 class UnaccentTransliterator
: public Transliterator
{
21 UnaccentTransliterator();
26 virtual ~UnaccentTransliterator();
31 * Implement Transliterator API
33 virtual void handleTransliterate(Replaceable
& text
,
34 UTransPosition
& index
,
35 UBool incremental
) const;
40 * Unaccent a single character using normalizer.
42 UChar
unaccent(UChar c
) const;
44 Normalizer normalizer
;
49 * Return the class ID for this class. This is useful only for
50 * comparing to a return value from getDynamicClassID(). For example:
52 * . Base* polymorphic_pointer = createPolymorphicObject();
53 * . if (polymorphic_pointer->getDynamicClassID() ==
54 * . Derived::getStaticClassID()) ...
56 * @return The class ID for all objects of this class.
59 static inline UClassID
getStaticClassID(void) { return (UClassID
)&fgClassID
; };
62 * Returns a unique class ID <b>polymorphically</b>. This method
63 * is to implement a simple version of RTTI, since not all C++
64 * compilers support genuine RTTI. Polymorphic operator==() and
65 * clone() methods call this method.
67 * <p>Concrete subclasses of Transliterator that wish clients to
68 * be able to identify them should implement getDynamicClassID()
69 * and also a static method and data member:
72 * static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
73 * static char fgClassID;
76 * Subclasses that do not implement this method will have a
77 * dynamic class ID of Transliterator::getStatisClassID().
79 * @return The class ID for this object. All objects of a given
80 * class have the same class ID. Objects of other classes have
81 * different class IDs.
84 virtual UClassID
getDynamicClassID(void) const { return getStaticClassID(); };
89 * Class identifier for subclasses of Transliterator that do not
90 * define their class (anonymous subclasses).
92 static const char fgClassID
;