summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/i18n/unicode/smpdtfmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/i18n/unicode/smpdtfmt.h')
-rw-r--r--deps/icu-small/source/i18n/unicode/smpdtfmt.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/deps/icu-small/source/i18n/unicode/smpdtfmt.h b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
index 9801b29bdb..305412b8d1 100644
--- a/deps/icu-small/source/i18n/unicode/smpdtfmt.h
+++ b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
@@ -50,6 +50,10 @@ class TimeZoneFormat;
class SharedNumberFormat;
class SimpleDateFormatMutableNFs;
+namespace number {
+class LocalizedNumberFormatter;
+}
+
/**
*
* SimpleDateFormat is a concrete class for formatting and parsing dates in a
@@ -1268,7 +1272,6 @@ private:
int32_t fieldNum,
FieldPositionHandler& handler,
Calendar& cal,
- SimpleDateFormatMutableNFs &mutableNFs,
UErrorCode& status) const; // in case of illegal argument
/**
@@ -1284,7 +1287,7 @@ private:
* @param minDigits Minimum number of digits the result should have
* @param maxDigits Maximum number of digits the result should have
*/
- void zeroPaddingNumber(NumberFormat *currentNumberFormat,
+ void zeroPaddingNumber(const NumberFormat *currentNumberFormat,
UnicodeString &appendTo,
int32_t value,
int32_t minDigits,
@@ -1414,21 +1417,21 @@ private:
*/
int32_t subParse(const UnicodeString& text, int32_t& start, char16_t ch, int32_t count,
UBool obeyCount, UBool allowNegative, UBool ambiguousYear[], int32_t& saveHebrewMonth, Calendar& cal,
- int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType, SimpleDateFormatMutableNFs &mutableNFs,
+ int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType,
int32_t *dayPeriod=NULL) const;
void parseInt(const UnicodeString& text,
Formattable& number,
ParsePosition& pos,
UBool allowNegative,
- NumberFormat *fmt) const;
+ const NumberFormat *fmt) const;
void parseInt(const UnicodeString& text,
Formattable& number,
int32_t maxDigits,
ParsePosition& pos,
UBool allowNegative,
- NumberFormat *fmt) const;
+ const NumberFormat *fmt) const;
int32_t checkIntSuffix(const UnicodeString& text, int32_t start,
int32_t patLoc, UBool isNegative) const;
@@ -1496,6 +1499,16 @@ private:
int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos) const;
/**
+ * Initialize LocalizedNumberFormatter instances used for speedup.
+ */
+ void initFastNumberFormatters(UErrorCode& status);
+
+ /**
+ * Delete the LocalizedNumberFormatter instances used for speedup.
+ */
+ void freeFastNumberFormatters();
+
+ /**
* Initialize NumberFormat instances used for numbering system overrides.
*/
void initNumberFormatters(const Locale &locale,UErrorCode &status);
@@ -1518,7 +1531,7 @@ private:
/**
* Lazy TimeZoneFormat instantiation, semantically const
*/
- TimeZoneFormat *tzFormat() const;
+ TimeZoneFormat *tzFormat(UErrorCode &status) const;
const NumberFormat* getNumberFormatByIndex(UDateFormatField index) const;
@@ -1611,6 +1624,20 @@ private:
*/
const SharedNumberFormat **fSharedNumberFormatters;
+ enum NumberFormatterKey {
+ SMPDTFMT_NF_1x10,
+ SMPDTFMT_NF_2x10,
+ SMPDTFMT_NF_3x10,
+ SMPDTFMT_NF_4x10,
+ SMPDTFMT_NF_2x2,
+ SMPDTFMT_NF_COUNT
+ };
+
+ /**
+ * Number formatters pre-allocated for fast performance on the most common integer lengths.
+ */
+ const number::LocalizedNumberFormatter* fFastNumberFormatters[SMPDTFMT_NF_COUNT] = {};
+
UBool fHaveDefaultCentury;
BreakIterator* fCapitalizationBrkIter;