12 #ifndef __DTPTNGEN_H__
13 #define __DTPTNGEN_H__
30 class DateTimeMatcher;
34 class SharedDateTimePatternGenerator;
69 #ifndef U_HIDE_INTERNAL_API
119 #ifndef U_HIDE_DRAFT_API
152 #ifndef U_HIDE_DRAFT_API
433 #ifndef U_HIDE_INTERNAL_API
512 DateTimeMatcher* dtMatcher;
513 DistanceInfo *distanceInfo;
514 PatternMap *patternMap;
519 DateTimeMatcher *skipMatcher;
520 Hashtable *fAvailableFormatKeyHash;
523 UChar fDefaultHourFormatChar;
525 int32_t fAllowedHourFormats[7];
530 kDTPGFixFractionalSeconds = 1,
531 kDTPGSkeletonUsesCapJ = 2,
532 kDTPGSkeletonUsesLowB = 3,
533 kDTPGSkeletonUsesCapB = 4
537 void addCanonicalItems();
549 const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields,
const PtnSkeleton** specifiedSkeletonPtr = 0);
552 int32_t getTopBitNumber(int32_t foundMask);
555 void copyHashtable(Hashtable *other,
UErrorCode &status);
557 static void loadAllowedHourFormatsData(
UErrorCode &status);
This class provides flexible generation of date format patterns, like "yy-MM-dd".
const UnicodeString & getPatternForSkeleton(const UnicodeString &skeleton) const
Get the pattern corresponding to a given skeleton.
static DateTimePatternGenerator * createEmptyInstance(UErrorCode &status)
Create an empty generator, to be constructed with addPattern(...) etc.
static UnicodeString staticGetSkeleton(const UnicodeString &pattern, UErrorCode &status)
Utility to return a unique skeleton from a given pattern.
StringEnumeration * getBaseSkeletons(UErrorCode &status) const
Return a list of all the base skeletons (in canonical form) from this class.
UnicodeString getBestPattern(const UnicodeString &skeleton, UErrorCode &status)
Return the best pattern matching the input skeleton.
static UnicodeString staticGetBaseSkeleton(const UnicodeString &pattern, UErrorCode &status)
Utility to return a unique base skeleton from a given pattern.
static DateTimePatternGenerator * createInstance(const Locale &uLocale, UErrorCode &status)
Construct a flexible generator according to data for a given locale.
void setAppendItemName(UDateTimePatternField field, const UnicodeString &value)
Sets the names of field, eg "era" in English for ERA.
void setDateTimeFormat(const UnicodeString &dateTimeFormat)
The DateTimeFormat is a message format pattern used to compose date and time patterns.
UBool operator!=(const DateTimePatternGenerator &other) const
Return true if another object is semantically unequal to this one.
const UnicodeString & getDecimal() const
Getter corresponding to setDecimal.
static UClassID getStaticClassID(void)
ICU "poor man's RTTI", returns a UClassID for this class.
void setDecimal(const UnicodeString &decimal)
The decimal value is used in formatting fractions of seconds.
UDateTimePatternConflict addPattern(const UnicodeString &pattern, UBool override, UnicodeString &conflictingPattern, UErrorCode &status)
Adds a pattern to the generator.
const UnicodeString & getDateTimeFormat() const
Getter corresponding to setDateTimeFormat.
UBool operator==(const DateTimePatternGenerator &other) const
Return true if another object is semantically equal to this one.
static DateTimePatternGenerator * createInstance(UErrorCode &status)
Construct a flexible generator according to default locale.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
DateTimePatternGenerator * clone() const
Clone DateTimePatternGenerator object.
const UnicodeString & getAppendItemFormat(UDateTimePatternField field) const
Getter corresponding to setAppendItemFormat.
StringEnumeration * getRedundants(UErrorCode &status)
Return a list of redundant patterns are those which if removed, make no difference in the resulting g...
UnicodeString replaceFieldTypes(const UnicodeString &pattern, const UnicodeString &skeleton, UErrorCode &status)
Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.
UnicodeString getSkeleton(const UnicodeString &pattern, UErrorCode &status)
Utility to return a unique skeleton from a given pattern.
UnicodeString replaceFieldTypes(const UnicodeString &pattern, const UnicodeString &skeleton, UDateTimePatternMatchOptions options, UErrorCode &status)
Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.
const UnicodeString & getAppendItemName(UDateTimePatternField field) const
Getter corresponding to setAppendItemNames.
UnicodeString getBestPattern(const UnicodeString &skeleton, UDateTimePatternMatchOptions options, UErrorCode &status)
Return the best pattern matching the input skeleton.
void setAppendItemFormat(UDateTimePatternField field, const UnicodeString &value)
An AppendItem format is a pattern used to append a field if there is no good match.
virtual ~DateTimePatternGenerator()
Destructor.
UnicodeString getBaseSkeleton(const UnicodeString &pattern, UErrorCode &status)
Utility to return a unique base skeleton from a given pattern.
StringEnumeration * getSkeletons(UErrorCode &status) const
Return a list of all the skeletons (in canonical form) from this class.
static DateTimePatternGenerator * internalMakeInstance(const Locale &uLocale, UErrorCode &status)
For ICU use only.
A Locale object represents a specific geographical, political, or cultural region.
Base class for 'pure' C++ implementations of uenum api.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C++ API: Abstract class for converting dates.
C++ API: Locale ID object.
C API: Wrapper for icu::DateTimePatternGenerator (unicode/dtptngen.h).
UDateTimePatternConflict
Status return values from udatpg_addPattern().
UDateTimePatternMatchOptions
Masks to control forcing the length of specified fields in the returned pattern to match those in the...
@ UDATPG_MATCH_NO_OPTIONS
UDateTimePatternField
Field number constants for udatpg_getAppendItemFormats() and similar functions.
int8_t UBool
The ICU boolean type.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.