* which must not indicate a failure before the function call.
* @stable ICU 3.8
*/
- static DateTimePatternGenerator* U_EXPORT2 createInstance(const Locale& uLocale, UErrorCode& status);
+ static DateTimePatternGenerator* U_EXPORT2 createInstance(const Locale& uLocale, UErrorCode& status, UBool skipICUData = FALSE);
#ifndef U_HIDE_INTERNAL_API
*/
const UnicodeString& getAppendItemName(UDateTimePatternField field) const;
-#ifndef U_HIDE_DRAFT_API
/**
* The general interface to get a display name for a particular date/time field,
* in one of several possible display widths.
* @param field The desired UDateTimePatternField, such as UDATPG_ERA_FIELD.
* @param width The desired UDateTimePGDisplayWidth, such as UDATPG_ABBREVIATED.
* @return. The display name for field
- * @draft ICU 61
+ * @stable ICU 61
*/
UnicodeString getFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width) const;
-#endif // U_HIDE_DRAFT_API
/**
* The DateTimeFormat is a message format pattern used to compose date and
private:
/**
* Constructor.
- * @stable ICU 3.8
*/
DateTimePatternGenerator(UErrorCode & status);
/**
* Constructor.
- * @stable ICU 3.8
*/
- DateTimePatternGenerator(const Locale& locale, UErrorCode & status);
+ DateTimePatternGenerator(const Locale& locale, UErrorCode & status, UBool skipICUData = FALSE);
/**
* Copy constructor.
* @param other DateTimePatternGenerator to copy
- * @stable ICU 3.8
*/
DateTimePatternGenerator(const DateTimePatternGenerator& other);
/**
* Default assignment operator.
* @param other DateTimePatternGenerator to copy
- * @stable ICU 3.8
*/
DateTimePatternGenerator& operator=(const DateTimePatternGenerator& other);
int32_t fAllowedHourFormats[7]; // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN.
+ // Internal error code used for recording/reporting errors that occur during methods that do not
+ // have a UErrorCode parameter. For example: the Copy Constructor, or the ::clone() method.
+ // When this is set to an error the object is in an invalid state.
+ UErrorCode internalErrorCode;
+
/* internal flags masks for adjustFieldTypes etc. */
enum {
kDTPGNoFlags = 0,
// with #13183, no longer need flags for b, B
};
- void initData(const Locale &locale, UErrorCode &status);
+ void initData(const Locale &locale, UErrorCode &status, UBool skipICUData = FALSE);
void addCanonicalItems(UErrorCode &status);
void addICUPatterns(const Locale& locale, UErrorCode& status);
void hackTimes(const UnicodeString& hackPattern, UErrorCode& status);
void setDecimalSymbols(const Locale& locale, UErrorCode& status);
UDateTimePatternField getAppendFormatNumber(const char* field) const;
#ifndef U_HIDE_DRAFT_API
+ // The following three have to be U_HIDE_DRAFT_API (though private) because UDateTimePGDisplayWidth is
UDateTimePatternField getFieldAndWidthIndices(const char* key, UDateTimePGDisplayWidth* widthP) const;
void setFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width, const UnicodeString& value);
UnicodeString& getMutableFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width);
void getAppendName(UDateTimePatternField field, UnicodeString& value);
UnicodeString mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UDateTimePatternMatchOptions options, UErrorCode& status);
int32_t getCanonicalIndex(const UnicodeString& field);
- const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, const PtnSkeleton** specifiedSkeletonPtr = 0);
+ const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, UErrorCode& status, const PtnSkeleton** specifiedSkeletonPtr = 0);
UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnSkeleton* specifiedSkeleton, int32_t flags, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
- UnicodeString getBestAppending(int32_t missingFields, int32_t flags, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
- int32_t getTopBitNumber(int32_t foundMask);
+ UnicodeString getBestAppending(int32_t missingFields, int32_t flags, UErrorCode& status, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
+ int32_t getTopBitNumber(int32_t foundMask) const;
void setAvailableFormat(const UnicodeString &key, UErrorCode& status);
UBool isAvailableFormatSet(const UnicodeString &key) const;
void copyHashtable(Hashtable *other, UErrorCode &status);