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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « icu46/source/i18n/remtrans.h ('k') | icu46/source/i18n/repattrn.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 **********************************************************************
3 * Copyright (c) 2001-2008, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Date Name Description
7 * 04/02/2001 aliu Creation.
8 **********************************************************************
9 */
10
11 #include "unicode/utypes.h"
12
13 #if !UCONFIG_NO_TRANSLITERATION
14
15 #include "remtrans.h"
16 #include "unicode/unifilt.h"
17
18 static const UChar CURR_ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
19
20 U_NAMESPACE_BEGIN
21
22 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RemoveTransliterator)
23
24 /**
25 * Factory method
26 */
27 static Transliterator* RemoveTransliterator_create(const UnicodeString& /*ID*/,
28 Transliterator::Token /*conte xt*/) {
29 /* We don't need the ID or context. We just remove data */
30 return new RemoveTransliterator();
31 }
32
33 /**
34 * System registration hook.
35 */
36 void RemoveTransliterator::registerIDs() {
37
38 Transliterator::_registerFactory(::CURR_ID, RemoveTransliterator_create, int egerToken(0));
39
40 Transliterator::_registerSpecialInverse(UNICODE_STRING_SIMPLE("Remove"),
41 UNICODE_STRING_SIMPLE("Null"), FALSE );
42 }
43
44 RemoveTransliterator::RemoveTransliterator() : Transliterator(::CURR_ID, 0) {}
45
46 RemoveTransliterator::~RemoveTransliterator() {}
47
48 Transliterator* RemoveTransliterator::clone(void) const {
49 Transliterator* result = new RemoveTransliterator();
50 if (result != NULL && getFilter() != 0) {
51 result->adoptFilter((UnicodeFilter*)(getFilter()->clone()));
52 }
53 return result;
54 }
55
56 void RemoveTransliterator::handleTransliterate(Replaceable& text, UTransPosition & index,
57 UBool /*isIncremental*/) const {
58 // Our caller (filteredTransliterate) has already narrowed us
59 // to an unfiltered run. Delete it.
60 UnicodeString empty;
61 text.handleReplaceBetween(index.start, index.limit, empty);
62 int32_t len = index.limit - index.start;
63 index.contextLimit -= len;
64 index.limit -= len;
65 }
66 U_NAMESPACE_END
67
68 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
OLDNEW
« 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