]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unicode/translit.h
ICU-531.30.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / translit.h
index 57f4f059591580abf3a2f06bf4ff8405bc151d4c..4973d424715a05e9674fb18ef44b0b0419a7f41e 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (C) 1999-2013, International Business Machines
+* Copyright (C) 1999-2014, International Business Machines
 * Corporation and others. All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -965,6 +965,11 @@ public:
     /**
      * Registers a factory function that creates transliterators of
      * a given ID.
+     *
+     * Because ICU may choose to cache Transliterators internally, this must
+     * be called at application startup, prior to any calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param id the ID being registered
      * @param factory a function pointer that will be copied and
      * called later when the given ID is passed to createInstance()
@@ -987,6 +992,10 @@ public:
      * After this call the Transliterator class owns the adoptedObj
      * and will delete it.
      *
+     * Because ICU may choose to cache Transliterators internally, this must
+     * be called at application startup, prior to any calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param adoptedObj an instance of subclass of
      * <code>Transliterator</code> that defines <tt>clone()</tt>
      * @see #createInstance
@@ -1085,6 +1094,10 @@ public:
      * Any attempt to construct an unregistered transliterator based
      * on its ID will fail.
      *
+     * Because ICU may choose to cache Transliterators internally, this should
+     * be called during application shutdown, after all calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param ID the ID of the transliterator or class
      * @return the <code>Object</code> that was registered with
      * <code>ID</code>, or <code>null</code> if none was
@@ -1308,6 +1321,7 @@ inline void Transliterator::setID(const UnicodeString& id) {
     ID.truncate(ID.length()-1);
 }
 
+#ifndef U_HIDE_INTERNAL_API
 inline Transliterator::Token Transliterator::integerToken(int32_t i) {
     Token t;
     t.integer = i;
@@ -1319,6 +1333,7 @@ inline Transliterator::Token Transliterator::pointerToken(void* p) {
     t.pointer = p;
     return t;
 }
+#endif  /* U_HIDE_INTERNAL_API */
 
 U_NAMESPACE_END