| OLD | NEW |
| 1 /* | 1 /* |
| 2 ********************************************************************** | 2 ********************************************************************** |
| 3 * Copyright (C) 1999-2013, International Business Machines | 3 * Copyright (C) 1999-2014, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ********************************************************************** | 5 ********************************************************************** |
| 6 * Date Name Description | 6 * Date Name Description |
| 7 * 11/17/99 aliu Creation. | 7 * 11/17/99 aliu Creation. |
| 8 ********************************************************************** | 8 ********************************************************************** |
| 9 */ | 9 */ |
| 10 #ifndef TRANSLIT_H | 10 #ifndef TRANSLIT_H |
| 11 #define TRANSLIT_H | 11 #define TRANSLIT_H |
| 12 | 12 |
| 13 #include "unicode/utypes.h" | 13 #include "unicode/utypes.h" |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 * @see #getTargetSet | 958 * @see #getTargetSet |
| 959 * @stable ICU 2.4 | 959 * @stable ICU 2.4 |
| 960 */ | 960 */ |
| 961 virtual UnicodeSet& getTargetSet(UnicodeSet& result) const; | 961 virtual UnicodeSet& getTargetSet(UnicodeSet& result) const; |
| 962 | 962 |
| 963 public: | 963 public: |
| 964 | 964 |
| 965 /** | 965 /** |
| 966 * Registers a factory function that creates transliterators of | 966 * Registers a factory function that creates transliterators of |
| 967 * a given ID. | 967 * a given ID. |
| 968 * |
| 969 * Because ICU may choose to cache Transliterators internally, this must |
| 970 * be called at application startup, prior to any calls to |
| 971 * Transliterator::createXXX to avoid undefined behavior. |
| 972 * |
| 968 * @param id the ID being registered | 973 * @param id the ID being registered |
| 969 * @param factory a function pointer that will be copied and | 974 * @param factory a function pointer that will be copied and |
| 970 * called later when the given ID is passed to createInstance() | 975 * called later when the given ID is passed to createInstance() |
| 971 * @param context a context pointer that will be stored and | 976 * @param context a context pointer that will be stored and |
| 972 * later passed to the factory function when an ID matching | 977 * later passed to the factory function when an ID matching |
| 973 * the registration ID is being instantiated with this factory. | 978 * the registration ID is being instantiated with this factory. |
| 974 * @stable ICU 2.0 | 979 * @stable ICU 2.0 |
| 975 */ | 980 */ |
| 976 static void U_EXPORT2 registerFactory(const UnicodeString& id, | 981 static void U_EXPORT2 registerFactory(const UnicodeString& id, |
| 977 Factory factory, | 982 Factory factory, |
| 978 Token context); | 983 Token context); |
| 979 | 984 |
| 980 /** | 985 /** |
| 981 * Registers an instance <tt>obj</tt> of a subclass of | 986 * Registers an instance <tt>obj</tt> of a subclass of |
| 982 * <code>Transliterator</code> with the system. When | 987 * <code>Transliterator</code> with the system. When |
| 983 * <tt>createInstance()</tt> is called with an ID string that is | 988 * <tt>createInstance()</tt> is called with an ID string that is |
| 984 * equal to <tt>obj->getID()</tt>, then <tt>obj->clone()</tt> is | 989 * equal to <tt>obj->getID()</tt>, then <tt>obj->clone()</tt> is |
| 985 * returned. | 990 * returned. |
| 986 * | 991 * |
| 987 * After this call the Transliterator class owns the adoptedObj | 992 * After this call the Transliterator class owns the adoptedObj |
| 988 * and will delete it. | 993 * and will delete it. |
| 989 * | 994 * |
| 995 * Because ICU may choose to cache Transliterators internally, this must |
| 996 * be called at application startup, prior to any calls to |
| 997 * Transliterator::createXXX to avoid undefined behavior. |
| 998 * |
| 990 * @param adoptedObj an instance of subclass of | 999 * @param adoptedObj an instance of subclass of |
| 991 * <code>Transliterator</code> that defines <tt>clone()</tt> | 1000 * <code>Transliterator</code> that defines <tt>clone()</tt> |
| 992 * @see #createInstance | 1001 * @see #createInstance |
| 993 * @see #registerFactory | 1002 * @see #registerFactory |
| 994 * @see #unregister | 1003 * @see #unregister |
| 995 * @stable ICU 2.0 | 1004 * @stable ICU 2.0 |
| 996 */ | 1005 */ |
| 997 static void U_EXPORT2 registerInstance(Transliterator* adoptedObj); | 1006 static void U_EXPORT2 registerInstance(Transliterator* adoptedObj); |
| 998 | 1007 |
| 999 /** | 1008 /** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1010 * the framework, although this isn't checked. | 1019 * the framework, although this isn't checked. |
| 1011 * @stable ICU 3.6 | 1020 * @stable ICU 3.6 |
| 1012 */ | 1021 */ |
| 1013 static void U_EXPORT2 registerAlias(const UnicodeString& aliasID, | 1022 static void U_EXPORT2 registerAlias(const UnicodeString& aliasID, |
| 1014 const UnicodeString& realID); | 1023 const UnicodeString& realID); |
| 1015 | 1024 |
| 1016 protected: | 1025 protected: |
| 1017 | 1026 |
| 1018 #ifndef U_HIDE_INTERNAL_API | 1027 #ifndef U_HIDE_INTERNAL_API |
| 1019 /** | 1028 /** |
| 1020 * @internal | |
| 1021 * @param id the ID being registered | 1029 * @param id the ID being registered |
| 1022 * @param factory a function pointer that will be copied and | 1030 * @param factory a function pointer that will be copied and |
| 1023 * called later when the given ID is passed to createInstance() | 1031 * called later when the given ID is passed to createInstance() |
| 1024 * @param context a context pointer that will be stored and | 1032 * @param context a context pointer that will be stored and |
| 1025 * later passed to the factory function when an ID matching | 1033 * later passed to the factory function when an ID matching |
| 1026 * the registration ID is being instantiated with this factory. | 1034 * the registration ID is being instantiated with this factory. |
| 1035 * @internal |
| 1027 */ | 1036 */ |
| 1028 static void _registerFactory(const UnicodeString& id, | 1037 static void _registerFactory(const UnicodeString& id, |
| 1029 Factory factory, | 1038 Factory factory, |
| 1030 Token context); | 1039 Token context); |
| 1031 | 1040 |
| 1032 /** | 1041 /** |
| 1033 * @internal | 1042 * @internal |
| 1034 */ | 1043 */ |
| 1035 static void _registerInstance(Transliterator* adoptedObj); | 1044 static void _registerInstance(Transliterator* adoptedObj); |
| 1036 | 1045 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 #endif /* U_HIDE_INTERNAL_API */ | 1087 #endif /* U_HIDE_INTERNAL_API */ |
| 1079 | 1088 |
| 1080 public: | 1089 public: |
| 1081 | 1090 |
| 1082 /** | 1091 /** |
| 1083 * Unregisters a transliterator or class. This may be either | 1092 * Unregisters a transliterator or class. This may be either |
| 1084 * a system transliterator or a user transliterator or class. | 1093 * a system transliterator or a user transliterator or class. |
| 1085 * Any attempt to construct an unregistered transliterator based | 1094 * Any attempt to construct an unregistered transliterator based |
| 1086 * on its ID will fail. | 1095 * on its ID will fail. |
| 1087 * | 1096 * |
| 1097 * Because ICU may choose to cache Transliterators internally, this should |
| 1098 * be called during application shutdown, after all calls to |
| 1099 * Transliterator::createXXX to avoid undefined behavior. |
| 1100 * |
| 1088 * @param ID the ID of the transliterator or class | 1101 * @param ID the ID of the transliterator or class |
| 1089 * @return the <code>Object</code> that was registered with | 1102 * @return the <code>Object</code> that was registered with |
| 1090 * <code>ID</code>, or <code>null</code> if none was | 1103 * <code>ID</code>, or <code>null</code> if none was |
| 1091 * @see #registerInstance | 1104 * @see #registerInstance |
| 1092 * @see #registerFactory | 1105 * @see #registerFactory |
| 1093 * @stable ICU 2.0 | 1106 * @stable ICU 2.0 |
| 1094 */ | 1107 */ |
| 1095 static void U_EXPORT2 unregister(const UnicodeString& ID); | 1108 static void U_EXPORT2 unregister(const UnicodeString& ID); |
| 1096 | 1109 |
| 1097 public: | 1110 public: |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 t.pointer = p; | 1333 t.pointer = p; |
| 1321 return t; | 1334 return t; |
| 1322 } | 1335 } |
| 1323 #endif /* U_HIDE_INTERNAL_API */ | 1336 #endif /* U_HIDE_INTERNAL_API */ |
| 1324 | 1337 |
| 1325 U_NAMESPACE_END | 1338 U_NAMESPACE_END |
| 1326 | 1339 |
| 1327 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | 1340 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ |
| 1328 | 1341 |
| 1329 #endif | 1342 #endif |
| OLD | NEW |