32 #if U_SHOW_CPLUSPLUS_API 38 #if !UCONFIG_NO_FORMATTING 48 class ICUServiceFactory;
197 #ifndef U_HIDE_DEPRECATED_API 212 DAY_OF_WEEK_IN_MONTH,
233 #ifndef U_HIDE_DEPRECATED_API 292 virtual Calendar* clone()
const = 0;
384 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
413 static UDate U_EXPORT2 getNow(
void);
567 #ifndef U_HIDE_DEPRECATED_API 825 void adoptTimeZone(
TimeZone* value);
834 void setTimeZone(
const TimeZone& zone);
844 const TimeZone& getTimeZone(
void)
const;
878 void setLenient(
UBool lenient);
886 UBool isLenient(
void)
const;
956 #ifndef U_HIDE_DEPRECATED_API 974 #ifndef U_HIDE_DEPRECATED_API 1002 void setMinimalDaysInFirstWeek(uint8_t value);
1013 uint8_t getMinimalDaysInFirstWeek(
void)
const;
1023 virtual int32_t getMinimum(
EDateFields field)
const;
1043 virtual int32_t getMaximum(
EDateFields field)
const;
1063 virtual int32_t getGreatestMinimum(
EDateFields field)
const;
1083 virtual int32_t getLeastMaximum(
EDateFields field)
const;
1095 #ifndef U_HIDE_DEPRECATED_API 1129 #ifndef U_HIDE_DEPRECATED_API 1167 #ifndef U_HIDE_DEPRECATED_API 1199 #ifndef U_HIDE_DEPRECATED_API 1221 #ifndef U_HIDE_DEPRECATED_API 1251 void set(int32_t year, int32_t month, int32_t date);
1265 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1280 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1290 #ifndef U_HIDE_DEPRECATED_API 1361 virtual const char * getType()
const = 0;
1415 virtual UBool isWeekend(
void)
const;
1476 virtual void computeTime(
UErrorCode& status);
1489 virtual void computeFields(
UErrorCode& status);
1500 double getTimeInMillis(
UErrorCode& status)
const;
1510 void setTimeInMillis(
double millis,
UErrorCode& status );
1523 #ifndef U_HIDE_DEPRECATED_API 1535 #ifndef U_HIDE_INTERNAL_API 1559 #ifndef U_HIDE_DEPRECATED_API 1569 void internalSet(
EDateFields field, int32_t value);
1596 #ifndef U_HIDE_INTERNAL_API 1597 UCAL_LIMIT_MINIMUM = 0,
1598 UCAL_LIMIT_GREATEST_MINIMUM,
1599 UCAL_LIMIT_LEAST_MAXIMUM,
1651 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1652 UBool useMonth)
const = 0;
1661 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1670 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1681 virtual int32_t handleGetExtendedYear() = 0;
1701 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1711 #ifndef U_HIDE_INTERNAL_API 1718 int32_t computeJulianDay();
1727 double computeMillisInDay();
1738 int32_t computeZoneOffset(
double millis,
double millisInDay,
UErrorCode &ec);
1820 #ifndef U_HIDE_INTERNAL_API 1947 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1949 #ifndef U_HIDE_INTERNAL_API 1956 return fGregorianYear;
1965 return fGregorianMonth;
1974 return fGregorianDayOfYear;
1983 return fGregorianDayOfMonth;
1993 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
2003 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
2084 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2087 #ifndef U_HIDE_INTERNAL_API 2118 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2124 int32_t getLocalDOW();
2138 void recalculateStamp();
2177 uint8_t fMinimalDaysInFirstWeek;
2179 int32_t fWeekendOnsetMillis;
2181 int32_t fWeekendCeaseMillis;
2193 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2211 int32_t fGregorianYear;
2218 int32_t fGregorianMonth;
2225 int32_t fGregorianDayOfYear;
2232 int32_t fGregorianDayOfMonth;
2242 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2253 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2301 #ifndef U_HIDE_INTERNAL_API 2311 static uint8_t julianDayToDayOfWeek(
double julian);
2319 #if !UCONFIG_NO_SERVICE 2324 #ifndef U_HIDE_INTERNAL_API 2370 friend class CalendarFactory;
2376 friend class CalendarService;
2382 friend class DefaultCalendarFactory;
2389 virtual UBool haveDefaultCentury()
const = 0;
2395 virtual UDate defaultCenturyStart()
const = 0;
2400 virtual int32_t defaultCenturyStartYear()
const = 0;
2415 virtual int32_t getRelatedYear(
UErrorCode &status)
const;
2422 virtual void setRelatedYear(int32_t year);
2424 #ifndef U_HIDE_INTERNAL_API 2451 #ifndef U_HIDE_INTERNAL_API 2460 static Calendar * U_EXPORT2 makeInstance(
2473 static void U_EXPORT2 getCalendarTypeFromLocale(
2476 int32_t typeBufferSize,
2487 return createInstance(zone, Locale::getDefault(), errorCode);
2495 roll(field, (int32_t)(up ? +1 : -1), status);
2498 #ifndef U_HIDE_DEPRECATED_API 2517 fFields[field] = value;
2518 fStamp[field] = kInternallySet;
2519 fIsSet[field] =
TRUE;
2523 #ifndef U_HIDE_INTERNAL_API 2526 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.