Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: icu46/source/i18n/remtrans.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/i18n/remtrans.h ('k') | icu46/source/i18n/repattrn.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/i18n/remtrans.cpp
===================================================================
--- icu46/source/i18n/remtrans.cpp (revision 0)
+++ icu46/source/i18n/remtrans.cpp (revision 0)
@@ -0,0 +1,68 @@
+/*
+**********************************************************************
+* Copyright (c) 2001-2008, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Date Name Description
+* 04/02/2001 aliu Creation.
+**********************************************************************
+*/
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_TRANSLITERATION
+
+#include "remtrans.h"
+#include "unicode/unifilt.h"
+
+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)
+
+/**
+ * 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() {
+
+ Transliterator::_registerFactory(::CURR_ID, RemoveTransliterator_create, integerToken(0));
+
+ Transliterator::_registerSpecialInverse(UNICODE_STRING_SIMPLE("Remove"),
+ UNICODE_STRING_SIMPLE("Null"), FALSE);
+}
+
+RemoveTransliterator::RemoveTransliterator() : Transliterator(::CURR_ID, 0) {}
+
+RemoveTransliterator::~RemoveTransliterator() {}
+
+Transliterator* RemoveTransliterator::clone(void) const {
+ Transliterator* result = new RemoveTransliterator();
+ if (result != NULL && getFilter() != 0) {
+ result->adoptFilter((UnicodeFilter*)(getFilter()->clone()));
+ }
+ return result;
+}
+
+void RemoveTransliterator::handleTransliterate(Replaceable& text, UTransPosition& index,
+ UBool /*isIncremental*/) const {
+ // Our caller (filteredTransliterate) has already narrowed us
+ // to an unfiltered run. Delete it.
+ UnicodeString empty;
+ text.handleReplaceBetween(index.start, index.limit, empty);
+ int32_t len = index.limit - index.start;
+ index.contextLimit -= len;
+ index.limit -= len;
+}
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_TRANSLITERATION */
Property changes on: icu46/source/i18n/remtrans.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/i18n/remtrans.h ('k') | icu46/source/i18n/repattrn.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698