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

UnicodeSet & Transliterator::getSourceSet ( UnicodeSet result  )  const [inherited]

Returns the set of all characters that may be modified in the input text by this Transliterator. This incorporates this object's current filter; if the filter is changed, the return value of this function will change. The default implementation returns an empty set. Some subclasses may override handleGetSourceSet to return a more precise result. The return result is approximate in any case and is intended for use by tests, tools, or utilities.

result receives result set; previous contents lost
a reference to result
See also:

handleGetSourceSet ICU 2.4

Definition at line 1180 of file translit.cpp.

References UnicodeMatcher::addMatchSetTo(), FALSE, Transliterator::filter, UnicodeFilter::getDynamicClassID(), UnicodeSet::getStaticClassID(), Transliterator::handleGetSourceSet(), NULL, UnicodeSet::retainAll(), and TRUE.

Referenced by CompoundTransliterator::handleGetSourceSet(), and TransliteratorTest::TestSourceTargetSet().

    if (filter != NULL) {
        UnicodeSet* filterSet;
        UBool deleteFilterSet = FALSE;
        // Most, but not all filters will be UnicodeSets.  Optimize for
        // the high-runner case.
        if (filter->getDynamicClassID() == UnicodeSet::getStaticClassID()) {
            filterSet = (UnicodeSet*) filter;
        } else {
            filterSet = new UnicodeSet();
            // Check null pointer
            if (filterSet == NULL) {
                return result;
            deleteFilterSet = TRUE;
        if (deleteFilterSet) {
            delete filterSet;
    return result;

Generated by  Doxygen 1.6.0   Back to index