32 #if U_SHOW_CPLUSPLUS_API 38 #if !UCONFIG_NO_FORMATTING 48 class ICUServiceFactory;
191 #ifndef U_FORCE_HIDE_DEPRECATED_API 199 #ifndef U_HIDE_DEPRECATED_API 214 DAY_OF_WEEK_IN_MONTH,
234 #endif // U_FORCE_HIDE_DEPRECATED_API 236 #ifndef U_HIDE_DEPRECATED_API 295 virtual Calendar* clone()
const = 0;
387 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
416 static UDate U_EXPORT2 getNow();
526 #ifndef U_FORCE_HIDE_DEPRECATED_API 547 virtual void add(EDateFields field, int32_t amount,
UErrorCode& status);
548 #endif // U_FORCE_HIDE_DEPRECATED_API 572 #ifndef U_HIDE_DEPRECATED_API 642 #ifndef U_FORCE_HIDE_DEPRECATED_API 674 virtual void roll(EDateFields field, int32_t amount,
UErrorCode& status);
675 #endif // U_FORCE_HIDE_DEPRECATED_API 710 #ifndef U_FORCE_HIDE_DEPRECATED_API 766 virtual int32_t fieldDifference(
UDate when, EDateFields field,
UErrorCode& status);
767 #endif // U_FORCE_HIDE_DEPRECATED_API 834 void adoptTimeZone(
TimeZone* value);
843 void setTimeZone(
const TimeZone& zone);
853 const TimeZone& getTimeZone()
const;
887 void setLenient(
UBool lenient);
895 UBool isLenient()
const;
973 #ifndef U_HIDE_DEPRECATED_API 980 EDaysOfWeek getFirstDayOfWeek()
const;
1001 void setMinimalDaysInFirstWeek(uint8_t value);
1012 uint8_t getMinimalDaysInFirstWeek()
const;
1014 #ifndef U_FORCE_HIDE_DEPRECATED_API 1023 virtual int32_t getMinimum(EDateFields field)
const;
1024 #endif // U_FORCE_HIDE_DEPRECATED_API 1036 #ifndef U_FORCE_HIDE_DEPRECATED_API 1045 virtual int32_t getMaximum(EDateFields field)
const;
1046 #endif // U_FORCE_HIDE_DEPRECATED_API 1058 #ifndef U_FORCE_HIDE_DEPRECATED_API 1067 virtual int32_t getGreatestMinimum(EDateFields field)
const;
1068 #endif // U_FORCE_HIDE_DEPRECATED_API 1080 #ifndef U_FORCE_HIDE_DEPRECATED_API 1089 virtual int32_t getLeastMaximum(EDateFields field)
const;
1090 #endif // U_FORCE_HIDE_DEPRECATED_API 1102 #ifndef U_HIDE_DEPRECATED_API 1117 int32_t getActualMinimum(EDateFields field,
UErrorCode& status)
const;
1198 void set(int32_t year, int32_t month, int32_t date);
1212 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1227 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1297 virtual const char * getType()
const = 0;
1351 virtual UBool isWeekend()
const;
1367 virtual bool inTemporalLeapYear(
UErrorCode& status)
const;
1387 virtual const char* getTemporalMonthCode(
UErrorCode& status)
const;
1408 virtual void setTemporalMonthCode(
const char* temporalMonth,
UErrorCode& status);
1469 virtual void computeTime(
UErrorCode& status);
1482 virtual void computeFields(
UErrorCode& status);
1493 double getTimeInMillis(
UErrorCode& status)
const;
1503 void setTimeInMillis(
double millis,
UErrorCode& status );
1516 #ifndef U_HIDE_DEPRECATED_API 1528 #ifndef U_HIDE_INTERNAL_API 1568 virtual int32_t internalGetMonth(
UErrorCode& status)
const;
1583 virtual int32_t internalGetMonth(int32_t defaultValue,
UErrorCode& status)
const;
1585 #ifndef U_HIDE_DEPRECATED_API 1595 void internalSet(EDateFields field, int32_t value);
1622 #ifndef U_HIDE_INTERNAL_API 1623 UCAL_LIMIT_MINIMUM = 0,
1624 UCAL_LIMIT_GREATEST_MINIMUM,
1625 UCAL_LIMIT_LEAST_MAXIMUM,
1652 virtual int32_t handleGetLimit(
UCalendarDateFields field, ELimitType limitType)
const = 0;
1678 virtual int64_t handleComputeMonthStart(int32_t eyear, int32_t month,
1688 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month,
UErrorCode& status)
const ;
1697 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1709 virtual int32_t handleGetExtendedYear(
UErrorCode& status) = 0;
1730 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy,
UErrorCode& status);
1740 #ifndef U_HIDE_INTERNAL_API 1748 int32_t computeJulianDay(
UErrorCode &status);
1757 double computeMillisInDay();
1768 int32_t computeZoneOffset(
double millis,
double millisInDay,
UErrorCode &ec);
1787 static constexpr int32_t kResolveSTOP = -1;
1797 static constexpr int32_t kResolveRemap = 32;
1863 #ifndef U_HIDE_INTERNAL_API 1943 #ifndef U_FORCE_HIDE_DEPRECATED_API 1949 #endif // U_FORCE_HIDE_DEPRECATED_API 1992 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1994 #ifndef U_HIDE_INTERNAL_API 2001 return fGregorianYear;
2010 return fGregorianMonth;
2019 return fGregorianDayOfYear;
2028 return fGregorianDayOfMonth;
2040 virtual int32_t getDefaultMonthInYear(int32_t eyear,
UErrorCode& status);
2052 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month,
UErrorCode& status);
2133 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2136 #ifndef U_HIDE_INTERNAL_API 2167 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2187 void recalculateStamp();
2226 uint8_t fMinimalDaysInFirstWeek;
2228 int32_t fWeekendOnsetMillis;
2230 int32_t fWeekendCeaseMillis;
2242 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2260 int32_t fGregorianYear;
2267 int32_t fGregorianMonth;
2274 int32_t fGregorianDayOfYear;
2281 int32_t fGregorianDayOfMonth;
2291 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2302 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2348 #ifndef U_HIDE_INTERNAL_API 2358 static uint8_t julianDayToDayOfWeek(int32_t julian);
2366 #if !UCONFIG_NO_SERVICE 2371 #ifndef U_HIDE_INTERNAL_API 2417 friend class CalendarFactory;
2423 friend class CalendarService;
2429 friend class DefaultCalendarFactory;
2436 virtual UBool haveDefaultCentury()
const = 0;
2442 virtual UDate defaultCenturyStart()
const = 0;
2447 virtual int32_t defaultCenturyStartYear()
const = 0;
2462 virtual int32_t getRelatedYear(
UErrorCode &status)
const;
2469 virtual void setRelatedYear(int32_t year);
2471 #ifndef U_HIDE_INTERNAL_API 2498 #ifndef U_HIDE_INTERNAL_API 2507 static Calendar * U_EXPORT2 makeInstance(
2520 static void U_EXPORT2 getCalendarTypeFromLocale(
2523 int32_t typeBufferSize,
2534 return createInstance(zone, Locale::getDefault(), errorCode);
2542 roll(field, static_cast<int32_t>(up ? +1 : -1), status);
2545 #ifndef U_HIDE_DEPRECATED_API 2549 roll(static_cast<UCalendarDateFields>(field), up, status);
2564 fFields[field] = value;
2565 fStamp[field] = kInternallySet;
2566 fIsSet[field] =
true;
2575 #define DECLARE_OVERRIDE_SYSTEM_DEFAULT_CENTURY \ 2576 virtual UBool haveDefaultCentury() const override; \ 2577 virtual UDate defaultCenturyStart() const override; \ 2578 virtual int32_t defaultCenturyStartYear() const override; 2580 #ifndef U_HIDE_INTERNAL_API 2581 inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)
2583 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);
UCalendarDateFields
Possible fields in a UCalendar.
Calendar is an abstract base class for converting between a UDate object and a set of integer fields ...
C++ API: TimeZone object.
double UDate
Date and Time data type.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
int32_t internalGet(EDateFields field) const
Gets the value for a given time field.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
C API: Miscellaneous definitions.
#define ULOC_FULLNAME_CAPACITY
Useful constant for the maximum size of the whole locale ID (including the terminating NULL and all k...
Base class for 'pure' C++ implementations of uenum api.
EMonths
Useful constants for month.
TimeZone represents a time zone offset, and also figures out daylight savings.
UCalendarWeekdayType
Weekday types, as returned by ucal_getDayOfWeekType().
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
UCalendarWallTimeOption
Options for handling ambiguous wall time at time zone offset transitions.
UBool fAreAllFieldsSet
True if all of the fields have been set.
UBool fIsTimeSet
The flag which indicates if the current time is set in the calendar.
virtual bool isEra0CountingBackward() const
The year in this calendar is counting from 1 backward if the era is 0.
UCalendarDaysOfWeek
Useful constant for days of week.
int32_t internalGet(UCalendarDateFields field, int32_t defaultValue) const
Gets the value for a given time field.
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
EAmpm
Useful constants for hour in 12-hour clock.
int32_t getGregorianYear() const
Return the extended year on the Gregorian calendar as computed by computeGregorianFields().
void setTime(UDate date, UErrorCode &status)
Sets this Calendar's current time with the given UDate.
BasicTimeZone is an abstract class extending TimeZone.
int32_t getGregorianDayOfMonth() const
Return the day of month (1-based) on the Gregorian calendar as computed by computeGregorianFields().
EDaysOfWeek
Useful constant for days of week.
UDate getTime(UErrorCode &status) const
Gets this Calendar's time as milliseconds.
C++ API: Common ICU base class UObject.
const void * URegistryKey
Opaque type returned by registerInstance, registerFactory and unregister for service registration...
int32_t getGregorianDayOfYear() const
Return the day of year (1-based) on the Gregorian calendar as computed by computeGregorianFields().
UDate internalGetTime() const
Get the current time without recomputing.
int32_t getGregorianMonth() const
Return the month (0-based) on the Gregorian calendar as computed by computeGregorianFields().
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
UBool fAreFieldsVirtuallySet
True if all fields have been virtually set, but have not yet been computed.
bool operator!=(const Calendar &that) const
Compares the inequality of two Calendar objects.
C++ API: Locale ID object.
EDateFields
Field IDs for date and time.
void internalSetTime(UDate time)
Set the current time without affecting flags or fields.
Basic definitions for ICU, for both C and C++ APIs.
One more than the highest normal UCalendarDateFields value.
UObject is the common ICU "boilerplate" class.
int32_t UFieldResolutionTable[12][8]
int32_t internalGet(UCalendarDateFields field) const
Gets the value for a given time field.
UBool fAreFieldsSet
True if the fields are in sync with the currently set time of this Calendar.
int8_t UBool
The ICU boolean type, a signed-byte integer.
A Locale object represents a specific geographical, political, or cultural region.