mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-1234 cleanup
X-SVN-Rev: 7712
This commit is contained in:
parent
0c41e609dc
commit
627e6e6575
5 changed files with 19 additions and 47 deletions
|
@ -57,19 +57,23 @@ CompoundTransliterator::CompoundTransliterator(
|
|||
CompoundTransliterator::CompoundTransliterator(const UnicodeString& id,
|
||||
UTransDirection direction,
|
||||
UnicodeFilter* adoptedFilter,
|
||||
UParseError& parseError,
|
||||
UParseError& /*parseError*/,
|
||||
UErrorCode& status) :
|
||||
Transliterator(id, adoptedFilter),
|
||||
trans(0), compoundRBTIndex(-1) {
|
||||
init(id, direction, -1, 0, TRUE,parseError,status);
|
||||
// TODO add code for parseError...currently unused, but
|
||||
// later may be used by parsing code...
|
||||
init(id, direction, -1, 0, TRUE, status);
|
||||
}
|
||||
|
||||
CompoundTransliterator::CompoundTransliterator(const UnicodeString& id,
|
||||
UParseError& parseError,
|
||||
UParseError& /*parseError*/,
|
||||
UErrorCode& status) :
|
||||
Transliterator(id, 0), // set filter to 0 here!
|
||||
trans(0), compoundRBTIndex(-1) {
|
||||
init(id, UTRANS_FORWARD, -1, 0, TRUE,parseError,status);
|
||||
// TODO add code for parseError...currently unused, but
|
||||
// later may be used by parsing code...
|
||||
init(id, UTRANS_FORWARD, -1, 0, TRUE, status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,12 +99,11 @@ CompoundTransliterator::CompoundTransliterator(const UnicodeString& newID,
|
|||
const UnicodeString& idBlock,
|
||||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedTrans,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status) :
|
||||
Transliterator(newID, 0),
|
||||
trans(0), compoundRBTIndex(-1)
|
||||
{
|
||||
init(idBlock, UTRANS_FORWARD, idSplitPoint, adoptedTrans, FALSE,parseError,status);
|
||||
init(idBlock, UTRANS_FORWARD, idSplitPoint, adoptedTrans, FALSE, status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,7 +127,6 @@ void CompoundTransliterator::init(const UnicodeString& id,
|
|||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedSplitTrans,
|
||||
UBool fixReverseID,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status) {
|
||||
// assert(trans == 0);
|
||||
|
||||
|
|
|
@ -856,6 +856,13 @@ Transliterator* Transliterator::createInverse(UErrorCode& status) const {
|
|||
return Transliterator::createInstance(ID, UTRANS_REVERSE,parseError,status);
|
||||
}
|
||||
|
||||
Transliterator* Transliterator::createInstance(const UnicodeString& ID,
|
||||
UTransDirection dir,
|
||||
UErrorCode& status) {
|
||||
UParseError parseError;
|
||||
return createInstance(ID, dir, parseError, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a <code>Transliterator</code> object given its ID.
|
||||
* The ID must be either a system transliterator ID or a ID registered
|
||||
|
@ -871,31 +878,6 @@ Transliterator* Transliterator::createInstance(const UnicodeString& ID,
|
|||
UTransDirection dir,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status) {
|
||||
return createInstance(ID, dir, -1, NULL, parseError, status);
|
||||
}
|
||||
|
||||
Transliterator* Transliterator::createInstance(const UnicodeString& ID,
|
||||
UTransDirection dir,
|
||||
UErrorCode& status) {
|
||||
UParseError parseError;
|
||||
return createInstance(ID, dir, -1, NULL, parseError, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a transliterator given a compound ID (possibly degenerate,
|
||||
* with no ID_DELIM). If idSplitPoint >= 0 and adoptedSplitTrans !=
|
||||
* 0, then insert adoptedSplitTrans in the compound ID at offset
|
||||
* idSplitPoint. Otherwise idSplitPoint should be -1 and
|
||||
* adoptedSplitTrans should be 0. The resultant transliterator will
|
||||
* be an atomic (non-compound) transliterator if this is indicated by
|
||||
* ID. Otherwise it will be a compound translitertor.
|
||||
*/
|
||||
Transliterator* Transliterator::createInstance(const UnicodeString& ID,
|
||||
UTransDirection dir,
|
||||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedSplitTrans,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status) {
|
||||
if (U_FAILURE(status)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1035,7 +1017,7 @@ Transliterator* Transliterator::createFromRules(const UnicodeString& ID,
|
|||
UnicodeString id("_", "");
|
||||
t = new RuleBasedTransliterator(id, parser.orphanData(), TRUE); // TRUE == adopt data object
|
||||
t = new CompoundTransliterator(ID, parser.idBlock, parser.idSplitPoint,
|
||||
t, parseError, status);
|
||||
t, status);
|
||||
if (U_FAILURE(status)) {
|
||||
delete t;
|
||||
t = 0;
|
||||
|
|
|
@ -73,7 +73,7 @@ Transliterator* TransliteratorAlias::create(UParseError& pe,
|
|||
t = Transliterator::createInstance(aliasID, UTRANS_FORWARD, pe, ec);
|
||||
} else {
|
||||
t = new CompoundTransliterator(ID, aliasID, idSplitPoint,
|
||||
trans, pe, ec);
|
||||
trans, ec);
|
||||
trans = 0; // so we don't delete it later
|
||||
if (compoundFilter) {
|
||||
t->adoptFilter((UnicodeSet*) compoundFilter->clone());
|
||||
|
|
|
@ -32,7 +32,7 @@ class TransliteratorRegistry;
|
|||
* <p>Copyright © IBM Corporation 1999. All rights reserved.
|
||||
*
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: cpdtrans.h,v $ $Revision: 1.26 $ $Date: 2002/02/07 00:59:24 $
|
||||
* @version $RCSfile: cpdtrans.h,v $ $Revision: 1.27 $ $Date: 2002/02/20 00:01:30 $
|
||||
* @deprecated To be removed after 2002-sep-30.
|
||||
*/
|
||||
class U_I18N_API CompoundTransliterator : public Transliterator {
|
||||
|
@ -181,7 +181,6 @@ private:
|
|||
const UnicodeString& idBlock,
|
||||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedTrans,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status);
|
||||
|
||||
/**
|
||||
|
@ -195,7 +194,6 @@ private:
|
|||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedRbt,
|
||||
UBool fixReverseID,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status);
|
||||
|
||||
void init(UVector& list,
|
||||
|
|
|
@ -301,16 +301,6 @@ protected:
|
|||
*/
|
||||
Transliterator& operator=(const Transliterator&);
|
||||
|
||||
/**
|
||||
* Internal factory method.
|
||||
*/
|
||||
static Transliterator* createInstance(const UnicodeString& ID,
|
||||
UTransDirection dir,
|
||||
int32_t idSplitPoint,
|
||||
Transliterator *adoptedSplitTrans,
|
||||
UParseError& parseError,
|
||||
UErrorCode& status);
|
||||
|
||||
/**
|
||||
* Create a transliterator from a basic ID. This is an ID
|
||||
* containing only the forward direction source, target, and
|
||||
|
|
Loading…
Add table
Reference in a new issue