/*
**********************************************************************
-* Copyright (c) 2002, International Business Machines Corporation
+* Copyright (c) 2002-2004, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
U_NAMESPACE_BEGIN
-const UChar EMPTY[] = { 0 }; // empty string: ""
+static const UChar EMPTY[] = { 0 }; // empty string: ""
-const char StringReplacer::fgClassID=0;
+UnicodeReplacer::~UnicodeReplacer() {}
+UOBJECT_DEFINE_RTTI_IMPLEMENTATION(StringReplacer)
/**
* Construct a StringReplacer that sets the emits the given output
/**
* Copy constructor.
*/
-StringReplacer::StringReplacer(const StringReplacer& other) {
+StringReplacer::StringReplacer(const StringReplacer& other) :
+ UnicodeFunctor(other),
+ UnicodeReplacer(other)
+{
output = other.output;
cursorPos = other.cursorPos;
hasCursor = other.hasCursor;
void StringReplacer::addReplacementSetTo(UnicodeSet& toUnionTo) const {
UChar32 ch;
for (int32_t i=0; i<output.length(); i+=UTF_CHAR_LENGTH(ch)) {
- ch = output.char32At(i);
- UnicodeReplacer* r = data->lookupReplacer(ch);
- if (r == NULL) {
- toUnionTo.add(ch);
- } else {
- r->addReplacementSetTo(toUnionTo);
- }
+ ch = output.char32At(i);
+ UnicodeReplacer* r = data->lookupReplacer(ch);
+ if (r == NULL) {
+ toUnionTo.add(ch);
+ } else {
+ r->addReplacementSetTo(toUnionTo);
+ }
}
}