void TimeUnitFormat::setup(UErrorCode& err) { initDataMembers(err); readFromCurrentLocale(kFull, gUnitsTag, err); checkConsistency(kFull, gUnitsTag, err); readFromCurrentLocale(kAbbreviate, gShortUnitsTag, err); checkConsistency(kAbbreviate, gShortUnitsTag, err); }
void TimeUnitFormat::setup(UErrorCode& err) { initDataMembers(err); UVector pluralCounts(0, uhash_compareUnicodeString, 6, err); StringEnumeration* keywords = getPluralRules().getKeywords(err); if (U_FAILURE(err)) { return; } UnicodeString* pluralCount; while ((pluralCount = const_cast<UnicodeString*>(keywords->snext(err))) != NULL) { pluralCounts.addElement(pluralCount, err); } readFromCurrentLocale(UTMUTFMT_FULL_STYLE, gUnitsTag, pluralCounts, err); checkConsistency(UTMUTFMT_FULL_STYLE, gUnitsTag, err); readFromCurrentLocale(UTMUTFMT_ABBREVIATED_STYLE, gShortUnitsTag, pluralCounts, err); checkConsistency(UTMUTFMT_ABBREVIATED_STYLE, gShortUnitsTag, err); delete keywords; }