// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** * Copyright (c) 2003-2008, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Author: Alan Liu * Created: September 2 2003 * Since: ICU 2.8 ********************************************************************** */ #ifndef GREGOIMP_H #define GREGOIMP_H #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #include "unicode/ures.h" #include "unicode/locid.h" #include "putilimp.h" U_NAMESPACE_BEGIN /** * A utility class providing mathematical functions used by time zone * and calendar code. Do not instantiate. Formerly just named 'Math'. * @internal */ class ClockMath { … }; // Useful millisecond constants #define kOneDay … #define kOneHour … #define kOneMinute … #define kOneSecond … #define kOneMillisecond … #define kOneWeek … // Epoch constants #define kJan1_1JulianDay … #define kEpochStartAsJulianDay … #define kEpochYear … #define kEarliestViableMillis … #define kLatestViableMillis … /** * The minimum supported Julian day. This value is equivalent to * MIN_MILLIS. */ #define MIN_JULIAN … /** * The minimum supported epoch milliseconds. This value is equivalent * to MIN_JULIAN. */ #define MIN_MILLIS … /** * The maximum supported Julian day. This value is equivalent to * MAX_MILLIS. */ #define MAX_JULIAN … /** * The maximum supported epoch milliseconds. This value is equivalent * to MAX_JULIAN. */ #define MAX_MILLIS … /** * A utility class providing proleptic Gregorian calendar functions * used by time zone and calendar code. Do not instantiate. * * Note: Unlike GregorianCalendar, all computations performed by this * class occur in the pure proleptic GregorianCalendar. */ class Grego { … }; inline double ClockMath::floorDivide(double numerator, double denominator) { … } inline UBool Grego::isLeapYear(int32_t year) { … } inline int8_t Grego::monthLength(int32_t year, int32_t month) { … } inline int8_t Grego::previousMonthLength(int y, int m) { … } inline void Grego::dayToFields(double day, int32_t& year, int32_t& month, int32_t& dom, int32_t& dow, UErrorCode& status) { … } inline double Grego::julianDayToMillis(int32_t julian) { … } inline int32_t Grego::millisToJulianDay(double millis) { … } inline int32_t Grego::gregorianShift(int32_t eyear) { … } U_NAMESPACE_END #endif // !UCONFIG_NO_FORMATTING #endif // GREGOIMP_H //eof