+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 2009-2012,2014 International Business Machines
+* Copyright (C) 2009-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: udatpg.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
}
U_CAPI int32_t U_EXPORT2
-udatpg_getSkeleton(UDateTimePatternGenerator *dtpg,
+udatpg_getSkeleton(UDateTimePatternGenerator * /* dtpg */,
const UChar *pattern, int32_t length,
UChar *skeleton, int32_t capacity,
UErrorCode *pErrorCode) {
return 0;
}
UnicodeString patternString((UBool)(length<0), pattern, length);
- UnicodeString result=((DateTimePatternGenerator *)dtpg)->getSkeleton(patternString, *pErrorCode);
+ UnicodeString result=DateTimePatternGenerator::staticGetSkeleton(
+ patternString, *pErrorCode);
return result.extract(skeleton, capacity, *pErrorCode);
}
U_CAPI int32_t U_EXPORT2
-udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg,
+udatpg_getBaseSkeleton(UDateTimePatternGenerator * /* dtpg */,
const UChar *pattern, int32_t length,
UChar *skeleton, int32_t capacity,
UErrorCode *pErrorCode) {
return 0;
}
UnicodeString patternString((UBool)(length<0), pattern, length);
- UnicodeString result=((DateTimePatternGenerator *)dtpg)->getBaseSkeleton(patternString, *pErrorCode);
+ UnicodeString result=DateTimePatternGenerator::staticGetBaseSkeleton(
+ patternString, *pErrorCode);
return result.extract(skeleton, capacity, *pErrorCode);
}
int32_t timeNonHourStart = -1;
int32_t timeNonHourLimit = 0;
UnicodeString skeleton, otherCycSkeleton;
- UnicodeString timePatChars(":ahHKkmsSzZOvVXx", -1, US_INV); // all pattern chars for times
+ UnicodeString timePatChars("abBhHKkmsSzZOvVXx", -1, US_INV); // all pattern chars for times
int32_t numForcedH = 0;
int32_t patPos, patLen = patternString.length();
}
if (inTimePat && !u_isWhitespace(patChr)) {
timePatLimit = patPos + 1;
- if (timeNonHourStart >= 0 && patChr!=LOW_A) { // NonHour portion should not include 'a'
+ if (timeNonHourStart >= 0 && patChr!=LOW_A && patChr!=LOW_B && patChr!=CAP_B) { // NonHour portion should not include 'a','b','B'
timeNonHourLimit = timePatLimit;
}
}