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

VTimeZone & VTimeZone::operator= ( const VTimeZone right  ) 

Assignment operator.

Parameters:
right The object to be copied. ICU 3.8

Definition at line 989 of file vtzone.cpp.

References UVector::addElement(), UnicodeString::clone(), TimeZone::clone(), UVector::elementAt(), icutzver, lastmod, NULL, olsonzid, TimeZone::operator=(), UVector::size(), tz, tzurl, U_FAILURE, U_SUCCESS, U_ZERO_ERROR, and vtzlines.

                                           {
    if (this == &right) {
        return *this;
    }
    if (*this != right) {
        BasicTimeZone::operator=(right);
        if (tz != NULL) {
            delete tz;
            tz = NULL;
        }
        if (right.tz != NULL) {
            tz = (BasicTimeZone*)right.tz->clone();
        }
        if (vtzlines != NULL) {
            delete vtzlines;
        }
        if (right.vtzlines != NULL) {
            UErrorCode status = U_ZERO_ERROR;
            int32_t size = right.vtzlines->size();
            vtzlines = new UVector(uhash_deleteUnicodeString, uhash_compareUnicodeString, size, status);
            if (U_SUCCESS(status)) {
                for (int32_t i = 0; i < size; i++) {
                    UnicodeString *line = (UnicodeString*)right.vtzlines->elementAt(i);
                    vtzlines->addElement(line->clone(), status);
                    if (U_FAILURE(status)) {
                        break;
                    }
                }
            }
            if (U_FAILURE(status) && vtzlines != NULL) {
                delete vtzlines;
                vtzlines = NULL;
            }
        }
        tzurl = right.tzurl;
        lastmod = right.lastmod;
        olsonzid = right.olsonzid;
        icutzver = right.icutzver;
    }
    return *this;
}


Generated by  Doxygen 1.6.0   Back to index