Lines Matching refs:errorCode
53 virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) {
54 ResourceTable dayPeriodData = value.getTable(errorCode);
55 if (U_FAILURE(errorCode)) { return; }
59 ResourceTable locales = value.getTable(errorCode);
60 if (U_FAILURE(errorCode)) { return; }
63 UnicodeString setNum_str = value.getUnicodeString(errorCode);
64 int32_t setNum = parseSetNum(setNum_str, errorCode);
65 uhash_puti(data->localeToRuleSetNumMap, const_cast<char *>(key), setNum, &errorCode);
71 errorCode = U_MEMORY_ALLOCATION_ERROR;
74 ResourceTable rules = value.getTable(errorCode);
75 processRules(rules, key, value, errorCode);
76 if (U_FAILURE(errorCode)) { return; }
82 ResourceValue &value, UErrorCode &errorCode) {
83 if (U_FAILURE(errorCode)) { return; }
86 ruleSetNum = parseSetNum(key, errorCode);
87 ResourceTable ruleSet = value.getTable(errorCode);
88 if (U_FAILURE(errorCode)) { return; }
93 errorCode = U_INVALID_FORMAT_ERROR;
96 ResourceTable periodDefinition = value.getTable(errorCode);
97 if (U_FAILURE(errorCode)) { return; }
103 addCutoff(type, value.getUnicodeString(errorCode), errorCode);
104 if (U_FAILURE(errorCode)) { return; }
108 ResourceArray cutoffArray = value.getArray(errorCode);
109 if (U_FAILURE(errorCode)) { return; }
114 addCutoff(cutoffType, value.getUnicodeString(errorCode), errorCode);
115 if (U_FAILURE(errorCode)) { return; }
119 setDayPeriodForHoursFromCutoffs(errorCode);
126 errorCode = U_INVALID_FORMAT_ERROR;
141 static int32_t parseSetNum(const UnicodeString &setNumStr, UErrorCode &errorCode) {
143 cs.appendInvariantChars(setNumStr, errorCode);
144 return parseSetNum(cs.data(), errorCode);
147 static int32_t parseSetNum(const char *setNumStr, UErrorCode &errorCode) {
148 if (U_FAILURE(errorCode)) { return -1; }
151 errorCode = U_INVALID_FORMAT_ERROR;
160 errorCode = U_INVALID_FORMAT_ERROR;
170 errorCode = U_INVALID_FORMAT_ERROR;
177 void addCutoff(CutoffType type, UnicodeString hour_str, UErrorCode &errorCode) {
178 if (U_FAILURE(errorCode)) { return; }
181 errorCode = U_INVALID_FORMAT_ERROR;
185 int32_t hour = parseHour(hour_str, errorCode);
186 if (U_FAILURE(errorCode)) { return; }
192 void setDayPeriodForHoursFromCutoffs(UErrorCode &errorCode) {
203 errorCode = U_INVALID_FORMAT_ERROR; // Bad data.
214 errorCode = U_INVALID_FORMAT_ERROR;
243 static int32_t parseHour(const UnicodeString &time, UErrorCode &errorCode) {
244 if (U_FAILURE(errorCode)) {
254 errorCode = U_INVALID_FORMAT_ERROR;
262 errorCode = U_INVALID_FORMAT_ERROR;
268 errorCode = U_INVALID_FORMAT_ERROR;
273 errorCode = U_INVALID_FORMAT_ERROR;
285 virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) {
286 ResourceTable rules = value.getTable(errorCode);
287 if (U_FAILURE(errorCode)) { return; }
290 int32_t setNum = DayPeriodRulesDataSink::parseSetNum(key, errorCode);
316 void U_CALLCONV DayPeriodRules::load(UErrorCode &errorCode) {
317 if (U_FAILURE(errorCode)) {
322 data->localeToRuleSetNumMap = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &errorCode);
323 LocalUResourceBundlePointer rb_dayPeriods(ures_openDirect(NULL, "dayPeriods", &errorCode));
327 ures_getAllItemsWithFallback(rb_dayPeriods.getAlias(), "rules", countSink, errorCode);
331 ures_getAllItemsWithFallback(rb_dayPeriods.getAlias(), "", sink, errorCode);
336 const DayPeriodRules *DayPeriodRules::getInstance(const Locale &locale, UErrorCode &errorCode) {
337 umtx_initOnce(initOnce, DayPeriodRules::load, errorCode);
341 if(U_FAILURE(errorCode)) { return NULL; }
355 errorCode = U_BUFFER_OVERFLOW_ERROR;
364 uloc_getParent(name, parentName, ULOC_FULLNAME_CAPACITY, &errorCode);
391 DayPeriodRules::DayPeriod dayPeriod, UErrorCode &errorCode) const {
392 if (U_FAILURE(errorCode)) { return -1; }
394 int32_t startHour = getStartHourForDayPeriod(dayPeriod, errorCode);
395 int32_t endHour = getEndHourForDayPeriod(dayPeriod, errorCode);
397 if (U_FAILURE(errorCode)) { return -1; }
414 DayPeriodRules::DayPeriod dayPeriod, UErrorCode &errorCode) const {
415 if (U_FAILURE(errorCode)) { return -1; }
436 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
441 DayPeriodRules::DayPeriod dayPeriod, UErrorCode &errorCode) const {
442 if (U_FAILURE(errorCode)) { return -1; }
464 errorCode = U_ILLEGAL_ARGUMENT_ERROR;