X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/0f5d89e82340278ed3d7d50029f37cab2c41a57e..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/i18n/unicode/dtptngen.h?ds=sidebyside diff --git a/icuSources/i18n/unicode/dtptngen.h b/icuSources/i18n/unicode/dtptngen.h index 2521c699..0803fc08 100644 --- a/icuSources/i18n/unicode/dtptngen.h +++ b/icuSources/i18n/unicode/dtptngen.h @@ -69,7 +69,7 @@ public: * 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 @@ -274,7 +274,6 @@ public: */ 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. @@ -282,10 +281,9 @@ public: * @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 @@ -499,27 +497,23 @@ public: 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); @@ -543,6 +537,11 @@ private: 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, @@ -551,7 +550,7 @@ private: // 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); @@ -564,6 +563,7 @@ private: 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); @@ -571,10 +571,10 @@ private: 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);