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

VTimeZone::VTimeZone ( const VTimeZone source  ) 

Copy constructor.

Parameters:
source The VTimeZone object to be copied. ICU 3.8

Definition at line 953 of file vtzone.cpp.

References UVector::addElement(), UnicodeString::clone(), TimeZone::clone(), UVector::elementAt(), NULL, UVector::size(), tz, U_FAILURE, U_SUCCESS, U_ZERO_ERROR, and vtzlines.

:   BasicTimeZone(source), tz(NULL), vtzlines(NULL),
    tzurl(source.tzurl), lastmod(source.lastmod),
    olsonzid(source.olsonzid), icutzver(source.icutzver) {
    if (source.tz != NULL) {
        tz = (BasicTimeZone*)source.tz->clone();
    }
    if (source.vtzlines != NULL) {
        UErrorCode status = U_ZERO_ERROR;
        int32_t size = source.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*)source.vtzlines->elementAt(i);
                vtzlines->addElement(line->clone(), status);
                if (U_FAILURE(status)) {
                    break;
                }
            }
        }
        if (U_FAILURE(status) && vtzlines != NULL) {
            delete vtzlines;
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index