• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 * Copyright (C) 2007-2016, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 *
9 * File DTPTNGEN.H
10 *
11 *******************************************************************************
12 */
13 
14 #ifndef __DTPTNGEN_H__
15 #define __DTPTNGEN_H__
16 
17 #include "unicode/datefmt.h"
18 #include "unicode/locid.h"
19 #include "unicode/udat.h"
20 #include "unicode/udatpg.h"
21 #include "unicode/unistr.h"
22 
23 U_NAMESPACE_BEGIN
24 
25 /**
26  * \file
27  * \brief C++ API: Date/Time Pattern Generator
28  */
29 
30 
31 class CharString;
32 class Hashtable;
33 class FormatParser;
34 class DateTimeMatcher;
35 class DistanceInfo;
36 class PatternMap;
37 class PtnSkeleton;
38 class SharedDateTimePatternGenerator;
39 
40 /**
41  * This class provides flexible generation of date format patterns, like "yy-MM-dd".
42  * The user can build up the generator by adding successive patterns. Once that
43  * is done, a query can be made using a "skeleton", which is a pattern which just
44  * includes the desired fields and lengths. The generator will return the "best fit"
45  * pattern corresponding to that skeleton.
46  * <p>The main method people will use is getBestPattern(String skeleton),
47  * since normally this class is pre-built with data from a particular locale.
48  * However, generators can be built directly from other data as well.
49  * <p><i>Issue: may be useful to also have a function that returns the list of
50  * fields in a pattern, in order, since we have that internally.
51  * That would be useful for getting the UI order of field elements.</i>
52  * @stable ICU 3.8
53 **/
54 class U_I18N_API DateTimePatternGenerator : public UObject {
55 public:
56     /**
57      * Construct a flexible generator according to default locale.
58      * @param status  Output param set to success/failure code on exit,
59      *               which must not indicate a failure before the function call.
60      * @stable ICU 3.8
61      */
62     static DateTimePatternGenerator* U_EXPORT2 createInstance(UErrorCode& status);
63 
64     /**
65      * Construct a flexible generator according to data for a given locale.
66      * @param uLocale
67      * @param status  Output param set to success/failure code on exit,
68      *               which must not indicate a failure before the function call.
69      * @stable ICU 3.8
70      */
71     static DateTimePatternGenerator* U_EXPORT2 createInstance(const Locale& uLocale, UErrorCode& status);
72 
73 #ifndef U_HIDE_INTERNAL_API
74 
75     /**
76      * For ICU use only
77      *
78      * @internal
79      */
80     static DateTimePatternGenerator* U_EXPORT2 internalMakeInstance(const Locale& uLocale, UErrorCode& status);
81 
82 #endif /* U_HIDE_INTERNAL_API */
83 
84     /**
85      * Create an empty generator, to be constructed with addPattern(...) etc.
86      * @param status  Output param set to success/failure code on exit,
87      *               which must not indicate a failure before the function call.
88      * @stable ICU 3.8
89      */
90      static DateTimePatternGenerator* U_EXPORT2 createEmptyInstance(UErrorCode& status);
91 
92     /**
93      * Destructor.
94      * @stable ICU 3.8
95      */
96     virtual ~DateTimePatternGenerator();
97 
98     /**
99      * Clone DateTimePatternGenerator object. Clients are responsible for
100      * deleting the DateTimePatternGenerator object cloned.
101      * @stable ICU 3.8
102      */
103     DateTimePatternGenerator* clone() const;
104 
105      /**
106       * Return true if another object is semantically equal to this one.
107       *
108       * @param other    the DateTimePatternGenerator object to be compared with.
109       * @return         true if other is semantically equal to this.
110       * @stable ICU 3.8
111       */
112     UBool operator==(const DateTimePatternGenerator& other) const;
113 
114     /**
115      * Return true if another object is semantically unequal to this one.
116      *
117      * @param other    the DateTimePatternGenerator object to be compared with.
118      * @return         true if other is semantically unequal to this.
119      * @stable ICU 3.8
120      */
121     UBool operator!=(const DateTimePatternGenerator& other) const;
122 
123     /**
124      * Utility to return a unique skeleton from a given pattern. For example,
125      * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
126      *
127      * @param pattern   Input pattern, such as "dd/MMM"
128      * @param status  Output param set to success/failure code on exit,
129      *                  which must not indicate a failure before the function call.
130      * @return skeleton such as "MMMdd"
131      * @stable ICU 56
132      */
133     static UnicodeString staticGetSkeleton(const UnicodeString& pattern, UErrorCode& status);
134 
135     /**
136      * Utility to return a unique skeleton from a given pattern. For example,
137      * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
138      * getSkeleton() works exactly like staticGetSkeleton().
139      * Use staticGetSkeleton() instead of getSkeleton().
140      *
141      * @param pattern   Input pattern, such as "dd/MMM"
142      * @param status  Output param set to success/failure code on exit,
143      *                  which must not indicate a failure before the function call.
144      * @return skeleton such as "MMMdd"
145      * @stable ICU 3.8
146      */
147     UnicodeString getSkeleton(const UnicodeString& pattern, UErrorCode& status); /* {
148         The function is commented out because it is a stable API calling a draft API.
149         After staticGetSkeleton becomes stable, staticGetSkeleton can be used and
150         these comments and the definition of getSkeleton in dtptngen.cpp should be removed.
151         return staticGetSkeleton(pattern, status);
152     }*/
153 
154     /**
155      * Utility to return a unique base skeleton from a given pattern. This is
156      * the same as the skeleton, except that differences in length are minimized
157      * so as to only preserve the difference between string and numeric form. So
158      * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd"
159      * (notice the single d).
160      *
161      * @param pattern  Input pattern, such as "dd/MMM"
162      * @param status  Output param set to success/failure code on exit,
163      *               which must not indicate a failure before the function call.
164      * @return base skeleton, such as "MMMd"
165      * @stable ICU 56
166      */
167     static UnicodeString staticGetBaseSkeleton(const UnicodeString& pattern, UErrorCode& status);
168 
169     /**
170      * Utility to return a unique base skeleton from a given pattern. This is
171      * the same as the skeleton, except that differences in length are minimized
172      * so as to only preserve the difference between string and numeric form. So
173      * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd"
174      * (notice the single d).
175      * getBaseSkeleton() works exactly like staticGetBaseSkeleton().
176      * Use staticGetBaseSkeleton() instead of getBaseSkeleton().
177      *
178      * @param pattern  Input pattern, such as "dd/MMM"
179      * @param status  Output param set to success/failure code on exit,
180      *               which must not indicate a failure before the function call.
181      * @return base skeleton, such as "MMMd"
182      * @stable ICU 3.8
183      */
184     UnicodeString getBaseSkeleton(const UnicodeString& pattern, UErrorCode& status); /* {
185         The function is commented out because it is a stable API calling a draft API.
186         After staticGetBaseSkeleton becomes stable, staticGetBaseSkeleton can be used and
187         these comments and the definition of getBaseSkeleton in dtptngen.cpp should be removed.
188         return staticGetBaseSkeleton(pattern, status);
189     }*/
190 
191     /**
192      * Adds a pattern to the generator. If the pattern has the same skeleton as
193      * an existing pattern, and the override parameter is set, then the previous
194      * value is overriden. Otherwise, the previous value is retained. In either
195      * case, the conflicting status is set and previous vale is stored in
196      * conflicting pattern.
197      * <p>
198      * Note that single-field patterns (like "MMM") are automatically added, and
199      * don't need to be added explicitly!
200      *
201      * @param pattern   Input pattern, such as "dd/MMM"
202      * @param override  When existing values are to be overridden use true,
203      *                   otherwise use false.
204      * @param conflictingPattern  Previous pattern with the same skeleton.
205      * @param status  Output param set to success/failure code on exit,
206      *               which must not indicate a failure before the function call.
207      * @return conflicting status.  The value could be UDATPG_NO_CONFLICT,
208      *                             UDATPG_BASE_CONFLICT or UDATPG_CONFLICT.
209      * @stable ICU 3.8
210      * <p>
211      * <h4>Sample code</h4>
212      * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
213      * \snippet samples/dtptngsample/dtptngsample.cpp addPatternExample
214      * <p>
215      */
216     UDateTimePatternConflict addPattern(const UnicodeString& pattern,
217                                         UBool override,
218                                         UnicodeString& conflictingPattern,
219                                         UErrorCode& status);
220 
221     /**
222      * An AppendItem format is a pattern used to append a field if there is no
223      * good match. For example, suppose that the input skeleton is "GyyyyMMMd",
224      * and there is no matching pattern internally, but there is a pattern
225      * matching "yyyyMMMd", say "d-MM-yyyy". Then that pattern is used, plus the
226      * G. The way these two are conjoined is by using the AppendItemFormat for G
227      * (era). So if that value is, say "{0}, {1}" then the final resulting
228      * pattern is "d-MM-yyyy, G".
229      * <p>
230      * There are actually three available variables: {0} is the pattern so far,
231      * {1} is the element we are adding, and {2} is the name of the element.
232      * <p>
233      * This reflects the way that the CLDR data is organized.
234      *
235      * @param field  such as UDATPG_ERA_FIELD.
236      * @param value  pattern, such as "{0}, {1}"
237      * @stable ICU 3.8
238      */
239     void setAppendItemFormat(UDateTimePatternField field, const UnicodeString& value);
240 
241     /**
242      * Getter corresponding to setAppendItemFormat. Values below 0 or at or
243      * above UDATPG_FIELD_COUNT are illegal arguments.
244      *
245      * @param  field  such as UDATPG_ERA_FIELD.
246      * @return append pattern for field
247      * @stable ICU 3.8
248      */
249     const UnicodeString& getAppendItemFormat(UDateTimePatternField field) const;
250 
251     /**
252      * Sets the names of field, eg "era" in English for ERA. These are only
253      * used if the corresponding AppendItemFormat is used, and if it contains a
254      * {2} variable.
255      * <p>
256      * This reflects the way that the CLDR data is organized.
257      *
258      * @param field   such as UDATPG_ERA_FIELD.
259      * @param value   name of the field
260      * @stable ICU 3.8
261      */
262     void setAppendItemName(UDateTimePatternField field, const UnicodeString& value);
263 
264     /**
265      * Getter corresponding to setAppendItemNames. Values below 0 or at or above
266      * UDATPG_FIELD_COUNT are illegal arguments. Note: The more general method
267      * for getting date/time field display names is getFieldDisplayName.
268      *
269      * @param field  such as UDATPG_ERA_FIELD.
270      * @return name for field
271      * @see getFieldDisplayName
272      * @stable ICU 3.8
273      */
274     const UnicodeString& getAppendItemName(UDateTimePatternField field) const;
275 
276 #ifndef U_HIDE_DRAFT_API
277     /**
278      * The general interface to get a display name for a particular date/time field,
279      * in one of several possible display widths.
280      *
281      * @param field  The desired UDateTimePatternField, such as UDATPG_ERA_FIELD.
282      * @param width  The desired UDateTimePGDisplayWidth, such as UDATPG_ABBREVIATED.
283      * @return.      The display name for field
284      * @draft ICU 61
285      */
286     UnicodeString getFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width) const;
287 #endif  // U_HIDE_DRAFT_API
288 
289     /**
290      * The DateTimeFormat is a message format pattern used to compose date and
291      * time patterns. The default pattern in the root locale is "{1} {0}", where
292      * {1} will be replaced by the date pattern and {0} will be replaced by the
293      * time pattern; however, other locales may specify patterns such as
294      * "{1}, {0}" or "{1} 'at' {0}", etc.
295      * <p>
296      * This is used when the input skeleton contains both date and time fields,
297      * but there is not a close match among the added patterns. For example,
298      * suppose that this object was created by adding "dd-MMM" and "hh:mm", and
299      * its datetimeFormat is the default "{1} {0}". Then if the input skeleton
300      * is "MMMdhmm", there is not an exact match, so the input skeleton is
301      * broken up into two components "MMMd" and "hmm". There are close matches
302      * for those two skeletons, so the result is put together with this pattern,
303      * resulting in "d-MMM h:mm".
304      *
305      * @param dateTimeFormat
306      *            message format pattern, here {1} will be replaced by the date
307      *            pattern and {0} will be replaced by the time pattern.
308      * @stable ICU 3.8
309      */
310     void setDateTimeFormat(const UnicodeString& dateTimeFormat);
311 
312     /**
313      * Getter corresponding to setDateTimeFormat.
314      * @return DateTimeFormat.
315      * @stable ICU 3.8
316      */
317     const UnicodeString& getDateTimeFormat() const;
318 
319     /**
320      * Return the best pattern matching the input skeleton. It is guaranteed to
321      * have all of the fields in the skeleton.
322      *
323      * @param skeleton
324      *            The skeleton is a pattern containing only the variable fields.
325      *            For example, "MMMdd" and "mmhh" are skeletons.
326      * @param status  Output param set to success/failure code on exit,
327      *               which must not indicate a failure before the function call.
328      * @return bestPattern
329      *            The best pattern found from the given skeleton.
330      * @stable ICU 3.8
331      * <p>
332      * <h4>Sample code</h4>
333      * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
334      * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample
335      * <p>
336      */
337      UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode& status);
338 
339 
340     /**
341      * Return the best pattern matching the input skeleton. It is guaranteed to
342      * have all of the fields in the skeleton.
343      *
344      * @param skeleton
345      *            The skeleton is a pattern containing only the variable fields.
346      *            For example, "MMMdd" and "mmhh" are skeletons.
347      * @param options
348      *            Options for forcing the length of specified fields in the
349      *            returned pattern to match those in the skeleton (when this
350      *            would not happen otherwise). For default behavior, use
351      *            UDATPG_MATCH_NO_OPTIONS.
352      * @param status
353      *            Output param set to success/failure code on exit,
354      *            which must not indicate a failure before the function call.
355      * @return bestPattern
356      *            The best pattern found from the given skeleton.
357      * @stable ICU 4.4
358      */
359      UnicodeString getBestPattern(const UnicodeString& skeleton,
360                                   UDateTimePatternMatchOptions options,
361                                   UErrorCode& status);
362 
363 
364     /**
365      * Adjusts the field types (width and subtype) of a pattern to match what is
366      * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
367      * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
368      * "dd-MMMM hh:mm". This is used internally to get the best match for the
369      * input skeleton, but can also be used externally.
370      *
371      * @param pattern Input pattern
372      * @param skeleton
373      *            The skeleton is a pattern containing only the variable fields.
374      *            For example, "MMMdd" and "mmhh" are skeletons.
375      * @param status  Output param set to success/failure code on exit,
376      *               which must not indicate a failure before the function call.
377      * @return pattern adjusted to match the skeleton fields widths and subtypes.
378      * @stable ICU 3.8
379      * <p>
380      * <h4>Sample code</h4>
381      * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
382      * \snippet samples/dtptngsample/dtptngsample.cpp replaceFieldTypesExample
383      * <p>
384      */
385      UnicodeString replaceFieldTypes(const UnicodeString& pattern,
386                                      const UnicodeString& skeleton,
387                                      UErrorCode& status);
388 
389     /**
390      * Adjusts the field types (width and subtype) of a pattern to match what is
391      * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
392      * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
393      * "dd-MMMM hh:mm". This is used internally to get the best match for the
394      * input skeleton, but can also be used externally.
395      *
396      * @param pattern Input pattern
397      * @param skeleton
398      *            The skeleton is a pattern containing only the variable fields.
399      *            For example, "MMMdd" and "mmhh" are skeletons.
400      * @param options
401      *            Options controlling whether the length of specified fields in the
402      *            pattern are adjusted to match those in the skeleton (when this
403      *            would not happen otherwise). For default behavior, use
404      *            UDATPG_MATCH_NO_OPTIONS.
405      * @param status
406      *            Output param set to success/failure code on exit,
407      *            which must not indicate a failure before the function call.
408      * @return pattern adjusted to match the skeleton fields widths and subtypes.
409      * @stable ICU 4.4
410      */
411      UnicodeString replaceFieldTypes(const UnicodeString& pattern,
412                                      const UnicodeString& skeleton,
413                                      UDateTimePatternMatchOptions options,
414                                      UErrorCode& status);
415 
416     /**
417      * Return a list of all the skeletons (in canonical form) from this class.
418      *
419      * Call getPatternForSkeleton() to get the corresponding pattern.
420      *
421      * @param status  Output param set to success/failure code on exit,
422      *               which must not indicate a failure before the function call.
423      * @return StringEnumeration with the skeletons.
424      *         The caller must delete the object.
425      * @stable ICU 3.8
426      */
427      StringEnumeration* getSkeletons(UErrorCode& status) const;
428 
429      /**
430       * Get the pattern corresponding to a given skeleton.
431       * @param skeleton
432       * @return pattern corresponding to a given skeleton.
433       * @stable ICU 3.8
434       */
435      const UnicodeString& getPatternForSkeleton(const UnicodeString& skeleton) const;
436 
437     /**
438      * Return a list of all the base skeletons (in canonical form) from this class.
439      *
440      * @param status  Output param set to success/failure code on exit,
441      *               which must not indicate a failure before the function call.
442      * @return a StringEnumeration with the base skeletons.
443      *         The caller must delete the object.
444      * @stable ICU 3.8
445      */
446      StringEnumeration* getBaseSkeletons(UErrorCode& status) const;
447 
448 #ifndef U_HIDE_INTERNAL_API
449      /**
450       * Return a list of redundant patterns are those which if removed, make no
451       * difference in the resulting getBestPattern values. This method returns a
452       * list of them, to help check the consistency of the patterns used to build
453       * this generator.
454       *
455       * @param status  Output param set to success/failure code on exit,
456       *               which must not indicate a failure before the function call.
457       * @return a StringEnumeration with the redundant pattern.
458       *         The caller must delete the object.
459       * @internal ICU 3.8
460       */
461      StringEnumeration* getRedundants(UErrorCode& status);
462 #endif  /* U_HIDE_INTERNAL_API */
463 
464     /**
465      * The decimal value is used in formatting fractions of seconds. If the
466      * skeleton contains fractional seconds, then this is used with the
467      * fractional seconds. For example, suppose that the input pattern is
468      * "hhmmssSSSS", and the best matching pattern internally is "H:mm:ss", and
469      * the decimal string is ",". Then the resulting pattern is modified to be
470      * "H:mm:ss,SSSS"
471      *
472      * @param decimal
473      * @stable ICU 3.8
474      */
475     void setDecimal(const UnicodeString& decimal);
476 
477     /**
478      * Getter corresponding to setDecimal.
479      * @return UnicodeString corresponding to the decimal point
480      * @stable ICU 3.8
481      */
482     const UnicodeString& getDecimal() const;
483 
484     /**
485      * ICU "poor man's RTTI", returns a UClassID for the actual class.
486      *
487      * @stable ICU 3.8
488      */
489     virtual UClassID getDynamicClassID() const;
490 
491     /**
492      * ICU "poor man's RTTI", returns a UClassID for this class.
493      *
494      * @stable ICU 3.8
495      */
496     static UClassID U_EXPORT2 getStaticClassID(void);
497 
498 private:
499     /**
500      * Constructor.
501      */
502     DateTimePatternGenerator(UErrorCode & status);
503 
504     /**
505      * Constructor.
506      */
507     DateTimePatternGenerator(const Locale& locale, UErrorCode & status);
508 
509     /**
510      * Copy constructor.
511      * @param other DateTimePatternGenerator to copy
512      */
513     DateTimePatternGenerator(const DateTimePatternGenerator& other);
514 
515     /**
516      * Default assignment operator.
517      * @param other DateTimePatternGenerator to copy
518      */
519     DateTimePatternGenerator& operator=(const DateTimePatternGenerator& other);
520 
521     // TODO(ticket:13619): re-enable when UDATPG_NARROW no longer in  draft mode.
522     // static const int32_t UDATPG_WIDTH_COUNT = UDATPG_NARROW + 1;
523 
524     Locale pLocale;  // pattern locale
525     FormatParser *fp;
526     DateTimeMatcher* dtMatcher;
527     DistanceInfo *distanceInfo;
528     PatternMap *patternMap;
529     UnicodeString appendItemFormats[UDATPG_FIELD_COUNT];
530     // TODO(ticket:13619): [3] -> UDATPG_WIDTH_COUNT
531     UnicodeString fieldDisplayNames[UDATPG_FIELD_COUNT][3];
532     UnicodeString dateTimeFormat;
533     UnicodeString decimal;
534     DateTimeMatcher *skipMatcher;
535     Hashtable *fAvailableFormatKeyHash;
536     UnicodeString emptyString;
537     char16_t fDefaultHourFormatChar;
538 
539     int32_t fAllowedHourFormats[7];  // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN.
540 
541     // Internal error code used for recording/reporting errors that occur during methods that do not
542     // have a UErrorCode parameter. For example: the Copy Constructor, or the ::clone() method.
543     // When this is set to an error the object is in an invalid state.
544     UErrorCode internalErrorCode;
545 
546     /* internal flags masks for adjustFieldTypes etc. */
547     enum {
548         kDTPGNoFlags = 0,
549         kDTPGFixFractionalSeconds = 1,
550         kDTPGSkeletonUsesCapJ = 2
551         // with #13183, no longer need flags for b, B
552     };
553 
554     void initData(const Locale &locale, UErrorCode &status);
555     void addCanonicalItems(UErrorCode &status);
556     void addICUPatterns(const Locale& locale, UErrorCode& status);
557     void hackTimes(const UnicodeString& hackPattern, UErrorCode& status);
558     void getCalendarTypeToUse(const Locale& locale, CharString& destination, UErrorCode& err);
559     void consumeShortTimePattern(const UnicodeString& shortTimePattern, UErrorCode& status);
560     void addCLDRData(const Locale& locale, UErrorCode& status);
561     UDateTimePatternConflict addPatternWithSkeleton(const UnicodeString& pattern, const UnicodeString * skeletonToUse, UBool override, UnicodeString& conflictingPattern, UErrorCode& status);
562     void initHashtable(UErrorCode& status);
563     void setDateTimeFromCalendar(const Locale& locale, UErrorCode& status);
564     void setDecimalSymbols(const Locale& locale, UErrorCode& status);
565     UDateTimePatternField getAppendFormatNumber(const char* field) const;
566 #ifndef U_HIDE_DRAFT_API
567     UDateTimePatternField getFieldAndWidthIndices(const char* key, UDateTimePGDisplayWidth* widthP) const;
568     void setFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width, const UnicodeString& value);
569     UnicodeString& getMutableFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width);
570 #endif  // U_HIDE_DRAFT_API
571     void getAppendName(UDateTimePatternField field, UnicodeString& value);
572     UnicodeString mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UErrorCode& status);
573     const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, UErrorCode& status, const PtnSkeleton** specifiedSkeletonPtr = 0);
574     UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnSkeleton* specifiedSkeleton, int32_t flags, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
575     UnicodeString getBestAppending(int32_t missingFields, int32_t flags, UErrorCode& status, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
576     int32_t getTopBitNumber(int32_t foundMask) const;
577     void setAvailableFormat(const UnicodeString &key, UErrorCode& status);
578     UBool isAvailableFormatSet(const UnicodeString &key) const;
579     void copyHashtable(Hashtable *other, UErrorCode &status);
580     UBool isCanonicalItem(const UnicodeString& item) const;
581     static void U_CALLCONV loadAllowedHourFormatsData(UErrorCode &status);
582     void getAllowedHourFormats(const Locale &locale, UErrorCode &status);
583 
584     struct AppendItemFormatsSink;
585     struct AppendItemNamesSink;
586     struct AvailableFormatsSink;
587 } ;// end class DateTimePatternGenerator
588 
589 U_NAMESPACE_END
590 
591 #endif
592