36 #if !UCONFIG_NO_FORMATTING 46 class ICUServiceFactory;
195 #ifndef U_HIDE_DEPRECATED_API 210 DAY_OF_WEEK_IN_MONTH,
231 #ifndef U_HIDE_DEPRECATED_API 290 virtual Calendar* clone(
void)
const = 0;
382 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
411 static UDate U_EXPORT2 getNow(
void);
565 #ifndef U_HIDE_DEPRECATED_API 823 void adoptTimeZone(
TimeZone* value);
832 void setTimeZone(
const TimeZone& zone);
842 const TimeZone& getTimeZone(
void)
const;
876 void setLenient(
UBool lenient);
884 UBool isLenient(
void)
const;
954 #ifndef U_HIDE_DEPRECATED_API 972 #ifndef U_HIDE_DEPRECATED_API 1000 void setMinimalDaysInFirstWeek(uint8_t value);
1011 uint8_t getMinimalDaysInFirstWeek(
void)
const;
1021 virtual int32_t getMinimum(
EDateFields field)
const;
1041 virtual int32_t getMaximum(
EDateFields field)
const;
1061 virtual int32_t getGreatestMinimum(
EDateFields field)
const;
1081 virtual int32_t getLeastMaximum(
EDateFields field)
const;
1093 #ifndef U_HIDE_DEPRECATED_API 1127 #ifndef U_HIDE_DEPRECATED_API 1165 #ifndef U_HIDE_DEPRECATED_API 1197 #ifndef U_HIDE_DEPRECATED_API 1219 #ifndef U_HIDE_DEPRECATED_API 1249 void set(int32_t year, int32_t month, int32_t date);
1263 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1278 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1288 #ifndef U_HIDE_DEPRECATED_API 1359 virtual const char * getType()
const = 0;
1413 virtual UBool isWeekend(
void)
const;
1474 virtual void computeTime(
UErrorCode& status);
1487 virtual void computeFields(
UErrorCode& status);
1498 double getTimeInMillis(
UErrorCode& status)
const;
1508 void setTimeInMillis(
double millis,
UErrorCode& status );
1521 #ifndef U_HIDE_DEPRECATED_API 1533 #ifndef U_HIDE_INTERNAL_API 1557 #ifndef U_HIDE_DEPRECATED_API 1567 void internalSet(
EDateFields field, int32_t value);
1594 #ifndef U_HIDE_INTERNAL_API 1595 UCAL_LIMIT_MINIMUM = 0,
1596 UCAL_LIMIT_GREATEST_MINIMUM,
1597 UCAL_LIMIT_LEAST_MAXIMUM,
1649 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1650 UBool useMonth)
const = 0;
1659 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1668 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1679 virtual int32_t handleGetExtendedYear() = 0;
1699 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1709 #ifndef U_HIDE_INTERNAL_API 1716 int32_t computeJulianDay();
1725 double computeMillisInDay();
1736 int32_t computeZoneOffset(
double millis,
double millisInDay,
UErrorCode &ec);
1818 #ifndef U_HIDE_INTERNAL_API 1945 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1947 #ifndef U_HIDE_INTERNAL_API 1954 return fGregorianYear;
1963 return fGregorianMonth;
1972 return fGregorianDayOfYear;
1981 return fGregorianDayOfMonth;
1991 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
2001 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
2082 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2085 #ifndef U_HIDE_INTERNAL_API 2116 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2122 int32_t getLocalDOW();
2136 void recalculateStamp();
2175 uint8_t fMinimalDaysInFirstWeek;
2177 int32_t fWeekendOnsetMillis;
2179 int32_t fWeekendCeaseMillis;
2191 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2209 int32_t fGregorianYear;
2216 int32_t fGregorianMonth;
2223 int32_t fGregorianDayOfYear;
2230 int32_t fGregorianDayOfMonth;
2240 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2251 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2299 #ifndef U_HIDE_INTERNAL_API 2309 static uint8_t julianDayToDayOfWeek(
double julian);
2317 #if !UCONFIG_NO_SERVICE 2322 #ifndef U_HIDE_INTERNAL_API 2368 friend class CalendarFactory;
2374 friend class CalendarService;
2380 friend class DefaultCalendarFactory;
2387 virtual UBool haveDefaultCentury()
const = 0;
2393 virtual UDate defaultCenturyStart()
const = 0;
2398 virtual int32_t defaultCenturyStartYear()
const = 0;
2413 virtual int32_t getRelatedYear(
UErrorCode &status)
const;
2420 virtual void setRelatedYear(int32_t year);
2422 #ifndef U_HIDE_INTERNAL_API 2449 #ifndef U_HIDE_INTERNAL_API 2458 static Calendar * U_EXPORT2 makeInstance(
2471 static void U_EXPORT2 getCalendarTypeFromLocale(
2474 int32_t typeBufferSize,
2485 return createInstance(zone, Locale::getDefault(), errorCode);
2493 roll(field, (int32_t)(up ? +1 : -1), status);
2496 #ifndef U_HIDE_DEPRECATED_API 2515 fFields[field] = value;
2516 fStamp[field] = kInternallySet;
2517 fIsSet[field] =
TRUE;
2521 #ifndef U_HIDE_INTERNAL_API 2524 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.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
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().
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
int32_t getGregorianMonth() const
Return the month (0-based) on the Gregorian calendar as computed by computeGregorianFields().
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
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.