Logo Search packages:      
Sourcecode: icu version File versions  Download package

void CompoundTransliterator::init ( const UnicodeString id,
UTransDirection  direction,
UBool  fixReverseID,
UErrorCode status 
) [private]

Finish constructing a transliterator: only to be called by constructors. Before calling init(), set trans and filter to NULL.

Parameters:
id the id containing ';'-separated entries
direction either FORWARD or REVERSE
idSplitPoint the index into id at which the adoptedSplitTransliterator should be inserted, if there is one, or -1 if there is none.
adoptedSplitTransliterator a transliterator to be inserted before the entry at offset idSplitPoint in the id string. May be NULL to insert no entry.
fixReverseID if TRUE, then reconstruct the ID of reverse entries by calling getID() of component entries. Some constructors do not require this because they apply a facade ID anyway.
status the error code indicating success or failure

Definition at line 148 of file cpdtrans.cpp.

References Transliterator::adoptFilter(), TransliteratorIDParser::instantiateList(), NULL, TransliteratorIDParser::parseCompoundID(), U_FAILURE, and U_INVALID_ID.

Referenced by CompoundTransliterator().

                                                      {
    // assert(trans == 0);

    if (U_FAILURE(status)) {
        return;
    }

    UVector list(status);
    UnicodeSet* compoundFilter = NULL;
    UnicodeString regenID;
    if (!TransliteratorIDParser::parseCompoundID(id, direction,
                                      regenID, list, compoundFilter)) {
        status = U_INVALID_ID;
        delete compoundFilter;
        return;
    }

    TransliteratorIDParser::instantiateList(list, status);

    init(list, direction, fixReverseID, status);

    if (compoundFilter != NULL) {
        adoptFilter(compoundFilter);
    }
}


Generated by  Doxygen 1.6.0   Back to index