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

void DateIntervalInfo::copyHash ( const Hashtable source,
Hashtable target,
UErrorCode status 
) [private]

copy hash table (of type fIntervalPatterns).

Parameters:
source the source to copy from
target the target to copy to
status output param set to success/failure code on exit

For internal use only.

ICU 4.0

Definition at line 630 of file dtitvinf.cpp.

References UHashElement::key, Hashtable::nextElement(), NULL, UHashTok::pointer, Hashtable::put(), U_FAILURE, and UHashElement::value.

Referenced by operator=().

                                               {
    if ( U_FAILURE(status) ) {
        return;
    }
    int32_t pos = -1;
    const UHashElement* element = NULL;
    if ( source ) {
        while ( (element = source->nextElement(pos)) != NULL ) {
            const UHashTok keyTok = element->key;
            const UnicodeString* key = (UnicodeString*)keyTok.pointer;
            const UHashTok valueTok = element->value;
            const UnicodeString* value = (UnicodeString*)valueTok.pointer;
            UnicodeString* copy = new UnicodeString[kIPI_MAX_INDEX];
            int8_t i;
            for ( i = 0; i < kIPI_MAX_INDEX; ++i ) {
                copy[i] = value[i];
            }
            target->put(UnicodeString(*key), copy, status);
            if ( U_FAILURE(status) ) {
                return;
            }
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index