Imported Upstream version 58.1
[platform/upstream/icu.git] / source / i18n / unicode / dtptngen.h
index eb8a445..fd617ce 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 * Copyright (C) 2007-2016, International Business Machines Corporation and
@@ -116,7 +118,6 @@ public:
      */
     UBool operator!=(const DateTimePatternGenerator& other) const;
 
-#ifndef U_HIDE_DRAFT_API
     /**
      * Utility to return a unique skeleton from a given pattern. For example,
      * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
@@ -125,10 +126,9 @@ public:
      * @param status  Output param set to success/failure code on exit,
      *                  which must not indicate a failure before the function call.
      * @return skeleton such as "MMMdd"
-     * @draft ICU 56
+     * @stable ICU 56
      */
     static UnicodeString staticGetSkeleton(const UnicodeString& pattern, UErrorCode& status);
-#endif  /* U_HIDE_DRAFT_API */
 
     /**
      * Utility to return a unique skeleton from a given pattern. For example,
@@ -149,7 +149,6 @@ public:
         return staticGetSkeleton(pattern, status);
     }*/
 
-#ifndef U_HIDE_DRAFT_API
     /**
      * Utility to return a unique base skeleton from a given pattern. This is
      * the same as the skeleton, except that differences in length are minimized
@@ -161,10 +160,9 @@ public:
      * @param status  Output param set to success/failure code on exit,
      *               which must not indicate a failure before the function call.
      * @return base skeleton, such as "MMMd"
-     * @draft ICU 56
+     * @stable ICU 56
      */
     static UnicodeString staticGetBaseSkeleton(const UnicodeString& pattern, UErrorCode& status);
-#endif  /* U_HIDE_DRAFT_API */
 
     /**
      * Utility to return a unique base skeleton from a given pattern. This is
@@ -518,7 +516,6 @@ private:
     UnicodeString decimal;
     DateTimeMatcher *skipMatcher;
     Hashtable *fAvailableFormatKeyHash;
-    UnicodeString hackPattern;
     UnicodeString emptyString;
     UChar fDefaultHourFormatChar;
 
@@ -534,9 +531,11 @@ private:
     };
 
     void initData(const Locale &locale, UErrorCode &status);
-    void addCanonicalItems();
+    void addCanonicalItems(UErrorCode &status);
     void addICUPatterns(const Locale& locale, UErrorCode& status);
     void hackTimes(const UnicodeString& hackPattern, UErrorCode& status);
+    void getCalendarTypeToUse(const Locale& locale, CharString& destination, UErrorCode& err);
+    void consumeShortTimePattern(const UnicodeString& shortTimePattern, UErrorCode& status);
     void addCLDRData(const Locale& locale, UErrorCode& status);
     UDateTimePatternConflict addPatternWithSkeleton(const UnicodeString& pattern, const UnicodeString * skeletonToUse, UBool override, UnicodeString& conflictingPattern, UErrorCode& status);
     void initHashtable(UErrorCode& status);
@@ -544,6 +543,7 @@ private:
     void setDecimalSymbols(const Locale& locale, UErrorCode& status);
     UDateTimePatternField getAppendFormatNumber(const char* field) const;
     UDateTimePatternField getAppendNameNumber(const char* field) const;
+    UnicodeString& getMutableAppendItemName(UDateTimePatternField field);
     void getAppendName(UDateTimePatternField field, UnicodeString& value);
     int32_t getCanonicalIndex(const UnicodeString& field);
     const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, const PtnSkeleton** specifiedSkeletonPtr = 0);
@@ -554,8 +554,12 @@ private:
     UBool isAvailableFormatSet(const UnicodeString &key) const;
     void copyHashtable(Hashtable *other, UErrorCode &status);
     UBool isCanonicalItem(const UnicodeString& item) const;
-    static void loadAllowedHourFormatsData(UErrorCode &status);
+    static void U_CALLCONV loadAllowedHourFormatsData(UErrorCode &status);
     void getAllowedHourFormats(const Locale &locale, UErrorCode &status);
+
+    struct AppendItemFormatsSink;
+    struct AppendItemNamesSink;
+    struct AvailableFormatsSink;
 } ;// end class DateTimePatternGenerator
 
 U_NAMESPACE_END