Logo Search packages:      
Sourcecode: icu version File versions  Download package

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

DateTimePatternGenerator Class Reference

#include <dtptngen.h>

Inheritance diagram for DateTimePatternGenerator:
Inheritance graph
Collaboration diagram for DateTimePatternGenerator:
Collaboration graph

List of all members.

Public Member Functions

UDateTimePatternConflict addPattern (const UnicodeString &pattern, UBool override, UnicodeString &conflictingPattern, UErrorCode &status)
DateTimePatternGeneratorclone () const
const UnicodeStringgetAppendItemFormat (UDateTimePatternField field) const
const UnicodeStringgetAppendItemName (UDateTimePatternField field) const
UnicodeString getBaseSkeleton (const UnicodeString &pattern, UErrorCode &status)
StringEnumerationgetBaseSkeletons (UErrorCode &status) const
UnicodeString getBestPattern (const UnicodeString &skeleton, UErrorCode &status)
const UnicodeStringgetDateTimeFormat () const
const UnicodeStringgetDecimal () const
virtual UClassID getDynamicClassID () const
const UnicodeStringgetPatternForSkeleton (const UnicodeString &skeleton) const
StringEnumerationgetRedundants (UErrorCode &status)
UnicodeString getSkeleton (const UnicodeString &pattern, UErrorCode &status)
StringEnumerationgetSkeletons (UErrorCode &status) const
UBool operator!= (const DateTimePatternGenerator &other) const
UBool operator== (const DateTimePatternGenerator &other) const
UnicodeString replaceFieldTypes (const UnicodeString &pattern, const UnicodeString &skeleton, UErrorCode &status)
void setAppendItemFormat (UDateTimePatternField field, const UnicodeString &value)
void setAppendItemName (UDateTimePatternField field, const UnicodeString &value)
void setDateTimeFormat (const UnicodeString &dateTimeFormat)
void setDecimal (const UnicodeString &decimal)
virtual ~DateTimePatternGenerator ()

Static Public Member Functions

createEmptyInstance (UErrorCode &status)
createInstance (const Locale &uLocale, UErrorCode &status)
createInstance (UErrorCode &status)
static UClassID U_EXPORT2 getStaticClassID (void)
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Private Member Functions

void addCanonicalItems ()
void addCLDRData (const Locale &locale, UErrorCode &status)
void addICUPatterns (const Locale &locale, UErrorCode &status)
UDateTimePatternConflict addPatternWithSkeleton (const UnicodeString &pattern, const UnicodeString *skeletonToUse, UBool override, UnicodeString &conflictingPattern, UErrorCode &status)
UnicodeString adjustFieldTypes (const UnicodeString &pattern, const PtnSkeleton *specifiedSkeleton, UBool fixFractionalSeconds)
void copyHashtable (Hashtable *other, UErrorCode &status)
 DateTimePatternGenerator (const Locale &locale, UErrorCode &status)
 DateTimePatternGenerator (const DateTimePatternGenerator &other)
 DateTimePatternGenerator (UErrorCode &status)
UDateTimePatternField getAppendFormatNumber (const char *field) const
void getAppendName (UDateTimePatternField field, UnicodeString &value)
UDateTimePatternField getAppendNameNumber (const char *field) const
UnicodeString getBestAppending (int32_t missingFields)
const UnicodeStringgetBestRaw (DateTimeMatcher &source, int32_t includeMask, DistanceInfo *missingFields, const PtnSkeleton **specifiedSkeletonPtr=0)
int32_t getCanonicalIndex (const UnicodeString &field)
int32_t getTopBitNumber (int32_t foundMask)
void hackTimes (const UnicodeString &hackPattern, UErrorCode &status)
void initData (const Locale &locale, UErrorCode &status)
void initHashtable (UErrorCode &status)
UBool isAvailableFormatSet (const UnicodeString &key) const
UBool isCanonicalItem (const UnicodeString &item) const
DateTimePatternGeneratoroperator= (const DateTimePatternGenerator &other)
void setAvailableFormat (const UnicodeString &key, UErrorCode &status)
void setDateTimeFromCalendar (const Locale &locale, UErrorCode &status)
void setDecimalSymbols (const Locale &locale, UErrorCode &status)

Private Attributes

UnicodeString appendItemFormats [UDATPG_FIELD_COUNT]
UnicodeString appendItemNames [UDATPG_FIELD_COUNT]
UnicodeString dateTimeFormat
UnicodeString decimal
UnicodeString emptyString
UChar fDefaultHourFormatChar
UnicodeString hackPattern
Locale pLocale

Detailed Description

This class provides flexible generation of date format patterns, like "yy-MM-dd". The user can build up the generator by adding successive patterns. Once that is done, a query can be made using a "skeleton", which is a pattern which just includes the desired fields and lengths. The generator will return the "best fit" pattern corresponding to that skeleton.

The main method people will use is getBestPattern(String skeleton), since normally this class is pre-built with data from a particular locale. However, generators can be built directly from other data as well.

Issue: may be useful to also have a function that returns the list of fields in a pattern, in order, since we have that internally. That would be useful for getting the UI order of field elements. ICU 3.8

Definition at line 49 of file dtptngen.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index