/* * Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 11/17/99 aliu Creation. ********************************************************************** */ #ifndef HEXTOUNI_H #define HEXTOUNI_H #include "translit.h" /** * A transliterator that converts from hexadecimal Unicode * escape sequences to the characters they represent. For example, "U+0040" * and '\u0040'. It recognizes the * prefixes "U+", "u+", "\U", and "\u". Hex values may be * upper- or lowercase. * *

Copyright © IBM Corporation 1999. All rights reserved. * * @author Alan Liu * @version $RCSfile: hextouni.h,v $ $Revision: 1.2 $ $Date: 1999/11/22 21:47:26 $ */ class U_I18N_API HexToUnicodeTransliterator : public Transliterator { /** * ID for this transliterator. */ static const char* _ID; public: /** * Constructs a transliterator. */ HexToUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0); /** * Destructor. */ virtual ~HexToUnicodeTransliterator(); /** * Copy constructor. */ HexToUnicodeTransliterator(const HexToUnicodeTransliterator&); /** * Assignment operator. */ HexToUnicodeTransliterator& operator=(const HexToUnicodeTransliterator&); /** * Transliterator API. */ Transliterator* clone() const; /** * Transliterates a segment of a string. Transliterator API. * @param text the string to be transliterated * @param start the beginning index, inclusive; 0 <= start * <= limit. * @param limit the ending index, exclusive; start <= limit * <= text.length(). * @return the new limit index */ virtual int32_t transliterate(Replaceable &text, int32_t start, int32_t limit) const; /** * Implements {@link Transliterator#handleKeyboardTransliterate}. */ virtual void handleKeyboardTransliterate(Replaceable& text, int32_t offsets[3]) const; /** * Return the length of the longest context required by this transliterator. * This is preceding context. * @param direction either FORWARD or REVERSE * @return maximum number of preceding context characters this * transliterator needs to examine */ virtual int32_t getMaximumContextLength() const; private: UChar filteredCharAt(Replaceable& text, int32_t i) const; }; inline HexToUnicodeTransliterator::~HexToUnicodeTransliterator() {} #endif