]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/remtrans.cpp
ICU-62141.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / remtrans.cpp
index 5c97883eeb211c80adf0d4d0f0abd221159fb21b..70a6ed3935b579848a9292d4fb6a44ea57796945 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
 /*
 **********************************************************************
-*   Copyright (c) 2001-2003, International Business Machines
+*   Copyright (c) 2001-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
 #if !UCONFIG_NO_TRANSLITERATION
 
 #include "remtrans.h"
 #if !UCONFIG_NO_TRANSLITERATION
 
 #include "remtrans.h"
+#include "unicode/unifilt.h"
 
 
-static const UChar ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
+static const UChar CURR_ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
 
 U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RemoveTransliterator)
 
 
 U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RemoveTransliterator)
 
+/**
+ * Factory method
+ */
+static Transliterator* RemoveTransliterator_create(const UnicodeString& /*ID*/,
+                                                   Transliterator::Token /*context*/) {
+    /* We don't need the ID or context. We just remove data */
+    return new RemoveTransliterator();
+}
+
 /**
  * System registration hook.
  */
 void RemoveTransliterator::registerIDs() {
 
 /**
  * System registration hook.
  */
 void RemoveTransliterator::registerIDs() {
 
-    Transliterator::_registerFactory(::ID, _create, integerToken(0));
+    Transliterator::_registerFactory(UnicodeString(TRUE, ::CURR_ID, -1),
+                                     RemoveTransliterator_create, integerToken(0));
 
     Transliterator::_registerSpecialInverse(UNICODE_STRING_SIMPLE("Remove"),
                                             UNICODE_STRING_SIMPLE("Null"), FALSE);
 }
 
 
     Transliterator::_registerSpecialInverse(UNICODE_STRING_SIMPLE("Remove"),
                                             UNICODE_STRING_SIMPLE("Null"), FALSE);
 }
 
-/**
- * Factory method
- */
-Transliterator* RemoveTransliterator::_create(const UnicodeString& /*ID*/,
-                                              Token /*context*/) {
-    /* We don't need the ID or context. We just remove data */
-    return new RemoveTransliterator();
-}
-
-RemoveTransliterator::RemoveTransliterator() : Transliterator(::ID, 0) {}
+RemoveTransliterator::RemoveTransliterator() : Transliterator(UnicodeString(TRUE, ::CURR_ID, -1), 0) {}
 
 RemoveTransliterator::~RemoveTransliterator() {}
 
 Transliterator* RemoveTransliterator::clone(void) const {
 
 RemoveTransliterator::~RemoveTransliterator() {}
 
 Transliterator* RemoveTransliterator::clone(void) const {
-    return new RemoveTransliterator();
+    Transliterator* result = new RemoveTransliterator();
+    if (result != NULL && getFilter() != 0) {
+        result->adoptFilter((UnicodeFilter*)(getFilter()->clone()));
+    }
+    return result;
 }
 
 void RemoveTransliterator::handleTransliterate(Replaceable& text, UTransPosition& index,
 }
 
 void RemoveTransliterator::handleTransliterate(Replaceable& text, UTransPosition& index,