00001 /* 00002 ********************************************************************** 00003 * Copyright (C) 1999-2002, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * Date Name Description 00007 * 11/17/99 aliu Creation. 00008 ********************************************************************** 00009 */ 00010 #ifndef HEXTOUNI_H 00011 #define HEXTOUNI_H 00012 00013 #include "unicode/translit.h" 00014 00015 U_NAMESPACE_BEGIN 00016 00031 class U_I18N_API HexToUnicodeTransliterator : public Transliterator { 00032 00036 static const char _ID[]; 00037 00041 static const UChar DEFAULT_PATTERN[]; 00042 00043 // Character constants defined here to avoid ASCII dependency 00044 enum { 00045 SEMICOLON = 0x003B, // ';' 00046 ZERO = 0x0030, // '0' 00047 POUND = 0x0023, // '#' 00048 BACKSLASH = 0x005C // '\\' 00049 }; 00050 00054 UnicodeString pattern; 00055 00060 UnicodeString affixes; 00061 00065 int32_t affixCount; 00066 00071 static const char fgClassID; 00072 00073 public: 00074 00081 HexToUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0); 00082 00088 HexToUnicodeTransliterator(const UnicodeString& pattern, 00089 UErrorCode& status); 00090 00097 HexToUnicodeTransliterator(const UnicodeString& pattern, 00098 UnicodeFilter* adoptedFilter, 00099 UErrorCode& status); 00100 00105 virtual ~HexToUnicodeTransliterator(); 00106 00111 HexToUnicodeTransliterator(const HexToUnicodeTransliterator&); 00112 00117 HexToUnicodeTransliterator& operator=(const HexToUnicodeTransliterator&); 00118 00123 Transliterator* clone(void) const; 00124 00152 void applyPattern(const UnicodeString& thePattern, UErrorCode& status); 00153 00158 const UnicodeString& toPattern(void) const; 00159 00164 virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, 00165 UBool isIncremental) const; 00166 00172 virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } 00173 00179 static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } 00180 }; 00181 00182 inline HexToUnicodeTransliterator::~HexToUnicodeTransliterator() {} 00183 00184 U_NAMESPACE_END 00185 00186 #endif