32 #if U_SHOW_CPLUSPLUS_API 38 #if !UCONFIG_NO_FORMATTING 48 class ICUServiceFactory;
189 #ifndef U_FORCE_HIDE_DEPRECATED_API 197 #ifndef U_HIDE_DEPRECATED_API 212 DAY_OF_WEEK_IN_MONTH,
232 #endif // U_FORCE_HIDE_DEPRECATED_API 234 #ifndef U_HIDE_DEPRECATED_API 293 virtual Calendar* clone()
const = 0;
385 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
414 static UDate U_EXPORT2 getNow(
void);
524 #ifndef U_FORCE_HIDE_DEPRECATED_API 546 #endif // U_FORCE_HIDE_DEPRECATED_API 570 #ifndef U_HIDE_DEPRECATED_API 640 #ifndef U_FORCE_HIDE_DEPRECATED_API 673 #endif // U_FORCE_HIDE_DEPRECATED_API 708 #ifndef U_FORCE_HIDE_DEPRECATED_API 765 #endif // U_FORCE_HIDE_DEPRECATED_API 832 void adoptTimeZone(
TimeZone* value);
841 void setTimeZone(
const TimeZone& zone);
851 const TimeZone& getTimeZone(
void)
const;
885 void setLenient(
UBool lenient);
893 UBool isLenient(
void)
const;
963 #ifndef U_HIDE_DEPRECATED_API 981 #ifndef U_HIDE_DEPRECATED_API 1009 void setMinimalDaysInFirstWeek(uint8_t value);
1020 uint8_t getMinimalDaysInFirstWeek(
void)
const;
1022 #ifndef U_FORCE_HIDE_DEPRECATED_API 1031 virtual int32_t getMinimum(
EDateFields field)
const;
1032 #endif // U_FORCE_HIDE_DEPRECATED_API 1044 #ifndef U_FORCE_HIDE_DEPRECATED_API 1053 virtual int32_t getMaximum(
EDateFields field)
const;
1054 #endif // U_FORCE_HIDE_DEPRECATED_API 1066 #ifndef U_FORCE_HIDE_DEPRECATED_API 1075 virtual int32_t getGreatestMinimum(
EDateFields field)
const;
1076 #endif // U_FORCE_HIDE_DEPRECATED_API 1088 #ifndef U_FORCE_HIDE_DEPRECATED_API 1097 virtual int32_t getLeastMaximum(
EDateFields field)
const;
1098 #endif // U_FORCE_HIDE_DEPRECATED_API 1110 #ifndef U_HIDE_DEPRECATED_API 1144 #ifndef U_HIDE_DEPRECATED_API 1182 #ifndef U_HIDE_DEPRECATED_API 1214 #ifndef U_HIDE_DEPRECATED_API 1236 #ifndef U_HIDE_DEPRECATED_API 1266 void set(int32_t year, int32_t month, int32_t date);
1280 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1295 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1305 #ifndef U_HIDE_DEPRECATED_API 1376 virtual const char * getType()
const = 0;
1430 virtual UBool isWeekend(
void)
const;
1491 virtual void computeTime(
UErrorCode& status);
1504 virtual void computeFields(
UErrorCode& status);
1515 double getTimeInMillis(
UErrorCode& status)
const;
1525 void setTimeInMillis(
double millis,
UErrorCode& status );
1538 #ifndef U_HIDE_DEPRECATED_API 1550 #ifndef U_HIDE_INTERNAL_API 1574 #ifndef U_HIDE_DEPRECATED_API 1584 void internalSet(
EDateFields field, int32_t value);
1611 #ifndef U_HIDE_INTERNAL_API 1612 UCAL_LIMIT_MINIMUM = 0,
1613 UCAL_LIMIT_GREATEST_MINIMUM,
1614 UCAL_LIMIT_LEAST_MAXIMUM,
1666 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1667 UBool useMonth)
const = 0;
1676 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1685 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1696 virtual int32_t handleGetExtendedYear() = 0;
1716 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1726 #ifndef U_HIDE_INTERNAL_API 1733 int32_t computeJulianDay();
1742 double computeMillisInDay();
1753 int32_t computeZoneOffset(
double millis,
double millisInDay,
UErrorCode &ec);
1835 #ifndef U_HIDE_INTERNAL_API 1915 #ifndef U_FORCE_HIDE_DEPRECATED_API 1921 #endif // U_FORCE_HIDE_DEPRECATED_API 1964 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1966 #ifndef U_HIDE_INTERNAL_API 1973 return fGregorianYear;
1982 return fGregorianMonth;
1991 return fGregorianDayOfYear;
2000 return fGregorianDayOfMonth;
2010 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
2020 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
2101 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2104 #ifndef U_HIDE_INTERNAL_API 2135 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2141 int32_t getLocalDOW();
2155 void recalculateStamp();
2194 uint8_t fMinimalDaysInFirstWeek;
2196 int32_t fWeekendOnsetMillis;
2198 int32_t fWeekendCeaseMillis;
2210 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2228 int32_t fGregorianYear;
2235 int32_t fGregorianMonth;
2242 int32_t fGregorianDayOfYear;
2249 int32_t fGregorianDayOfMonth;
2259 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2270 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2316 #ifndef U_HIDE_INTERNAL_API 2326 static uint8_t julianDayToDayOfWeek(
double julian);
2334 #if !UCONFIG_NO_SERVICE 2339 #ifndef U_HIDE_INTERNAL_API 2385 friend class CalendarFactory;
2391 friend class CalendarService;
2397 friend class DefaultCalendarFactory;
2404 virtual UBool haveDefaultCentury()
const = 0;
2410 virtual UDate defaultCenturyStart()
const = 0;
2415 virtual int32_t defaultCenturyStartYear()
const = 0;
2430 virtual int32_t getRelatedYear(
UErrorCode &status)
const;
2437 virtual void setRelatedYear(int32_t year);
2439 #ifndef U_HIDE_INTERNAL_API 2466 #ifndef U_HIDE_INTERNAL_API 2475 static Calendar * U_EXPORT2 makeInstance(
2488 static void U_EXPORT2 getCalendarTypeFromLocale(
2491 int32_t typeBufferSize,
2502 return createInstance(zone, Locale::getDefault(), errorCode);
2510 roll(field, (int32_t)(up ? +1 : -1), status);
2513 #ifndef U_HIDE_DEPRECATED_API 2532 fFields[field] = value;
2533 fStamp[field] = kInternallySet;
2534 fIsSet[field] =
TRUE;
2538 #ifndef U_HIDE_INTERNAL_API 2541 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);
UCalendarDateFields
Possible fields in a UCalendar.
UDate internalGetTime(void) const
Get the current time without recomputing.
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.
#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().
int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek)
Return the week number of a day, within a period.
#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.
static Calendar * createInstance(UErrorCode &success)
Creates a Calendar using the default timezone and locale.
UCalendarDaysOfWeek
Useful constant for days of week.
int32_t internalGet(UCalendarDateFields field, int32_t defaultValue) const
Gets the value for a given time field.
void internalSet(EDateFields field, int32_t value)
Sets the value for a given time field.
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
void roll(EDateFields field, UBool up, UErrorCode &status)
Time Field Rolling function.
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.
#define TRUE
The TRUE value of a UBool.
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().
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.
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.
UBool operator!=(const Calendar &that) const
Compares the inequality of two Calendar objects.
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 Locale object represents a specific geographical, political, or cultural region.