34 #if !UCONFIG_NO_FORMATTING
44 class ICUServiceFactory;
175 #ifndef U_HIDE_DEPRECATED_API
190 DAY_OF_WEEK_IN_MONTH,
218 #ifndef U_HIDE_DEPRECATED_API
234 #ifndef U_HIDE_DEPRECATED_API
256 #ifndef U_HIDE_DEPRECATED_API
274 virtual Calendar* clone(
void)
const = 0;
522 virtual void add(EDateFields field, int32_t amount,
UErrorCode& status);
615 virtual void roll(EDateFields field, int32_t amount,
UErrorCode& status);
696 virtual int32_t fieldDifference(
UDate when, EDateFields field,
UErrorCode& status);
763 void adoptTimeZone(
TimeZone* value);
772 void setTimeZone(
const TimeZone& zone);
782 const TimeZone& getTimeZone(
void)
const;
816 void setLenient(
UBool lenient);
824 UBool isLenient(
void)
const;
832 void setFirstDayOfWeek(EDaysOfWeek value);
848 EDaysOfWeek getFirstDayOfWeek(
void)
const;
868 void setMinimalDaysInFirstWeek(uint8_t value);
879 uint8_t getMinimalDaysInFirstWeek(
void)
const;
889 virtual int32_t getMinimum(EDateFields field)
const;
909 virtual int32_t getMaximum(EDateFields field)
const;
929 virtual int32_t getGreatestMinimum(EDateFields field)
const;
949 virtual int32_t getLeastMaximum(EDateFields field)
const;
975 int32_t getActualMinimum(EDateFields field,
UErrorCode& status)
const;
1009 int32_t getActualMaximum(EDateFields field,
UErrorCode& status)
const;
1042 int32_t
get(EDateFields field,
UErrorCode& status)
const;
1067 UBool isSet(EDateFields field)
const;
1086 void set(EDateFields field, int32_t value);
1107 void set(int32_t year, int32_t month, int32_t date);
1121 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1136 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1154 void clear(EDateFields field);
1191 virtual const char * getType()
const = 0;
1244 virtual UBool isWeekend(
void)
const;
1305 virtual void computeTime(
UErrorCode& status);
1318 virtual void computeFields(
UErrorCode& status);
1329 double getTimeInMillis(
UErrorCode& status)
const;
1339 void setTimeInMillis(
double millis,
UErrorCode& status );
1393 void internalSet(EDateFields field, int32_t value);
1419 UCAL_LIMIT_MINIMUM = 0,
1420 UCAL_LIMIT_GREATEST_MINIMUM,
1421 UCAL_LIMIT_LEAST_MAXIMUM,
1447 virtual int32_t handleGetLimit(
UCalendarDateFields field, ELimitType limitType)
const = 0;
1472 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1473 UBool useMonth)
const = 0;
1482 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1491 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1502 virtual int32_t handleGetExtendedYear() = 0;
1522 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1530 int32_t computeJulianDay();
1539 int32_t computeMillisInDay();
1550 int32_t computeZoneOffset(
double millis, int32_t millisInDay,
UErrorCode &ec);
1756 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1764 return fGregorianYear;
1773 return fGregorianMonth;
1782 return fGregorianDayOfYear;
1791 return fGregorianDayOfMonth;
1800 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
1810 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
1891 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
1924 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
1930 int32_t getLocalDOW();
1943 void recalculateStamp();
1970 uint8_t fMinimalDaysInFirstWeek;
1972 int32_t fWeekendOnsetMillis;
1974 int32_t fWeekendCeaseMillis;
1986 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2004 int32_t fGregorianYear;
2011 int32_t fGregorianMonth;
2018 int32_t fGregorianDayOfYear;
2025 int32_t fGregorianDayOfMonth;
2035 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2046 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2113 static uint8_t julianDayToDayOfWeek(
double julian);
2120 #if !UCONFIG_NO_SERVICE
2159 friend class CalendarFactory;
2165 friend class CalendarService;
2171 friend class DefaultCalendarFactory;
2178 virtual UBool haveDefaultCentury()
const = 0;
2184 virtual UDate defaultCenturyStart()
const = 0;
2189 virtual int32_t defaultCenturyStartYear()
const = 0;
2223 roll(field, (int32_t)(up ? +1 : -1), status);
2244 fStamp[field] = kInternallySet;
2250 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);
int32_t getGregorianYear() const
Return the extended year on the Gregorian calendar as computed by computeGregorianFields().
void roll(EDateFields field, UBool up, UErrorCode &status)
Time Field Rolling function.
UCalendarDateFields
Possible fields in a UCalendar.
Calendar is an abstract base class for converting between a UDate object and a set of integer fields ...
UBool fIsTimeSet
The flag which indicates if the current time is set in the calendar.
void internalSetTime(UDate time)
Set the current time without affecting flags or fields.
int32_t internalGet(EDateFields field) const
Gets the value for a given time field.
EAmpm
Useful constants for hour in 12-hour clock.
C++ API: TimeZone object.
double UDate
Date and Time data type.
UBool fIsSet[UCAL_FIELD_COUNT]
The flags which tell if a specified time field for the calendar is set.
int32_t getGregorianDayOfYear() const
Return the day of year (1-based) on the Gregorian calendar as computed by computeGregorianFields().
int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek)
Return the week number of a day, within a period.
int32_t getGregorianDayOfMonth() const
Return the day of month (1-based) on the Gregorian calendar as computed by computeGregorianFields().
#define ULOC_FULLNAME_CAPACITY
Useful constant for the maximum size of the whole locale ID (including the terminating NULL and all k...
void internalSet(EDateFields field, int32_t value)
Sets the value for a given time field.
UCalendarWeekdayType
Weekday types, as returned by ucal_getDayOfWeekType().
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
void setTime(UDate date, UErrorCode &status)
Sets this Calendar's current time with the given UDate.
EDateFields
Field IDs for date and time.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
UCalendarDaysOfWeek
Useful constant for days of week.
EDaysOfWeek
Useful constant for days of week.
UBool fAreFieldsVirtuallySet
True if all fields have been virtually set, but have not yet been computed.
UDate internalGetTime(void) const
Get the current time without recomputing.
UBool fAreAllFieldsSet
True if all of the fields have been set.
#define TRUE
The TRUE value of a UBool.
int32_t fStamp[UCAL_FIELD_COUNT]
Pseudo-time-stamps which specify when each field was set.
int32_t internalGet(UCalendarDateFields field) const
Gets the value for a given time field.
C++ API: Common ICU base class UObject.
const void * URegistryKey
Opaque type returned by registerInstance, registerFactory and unregister for service registration...
int32_t internalGet(UCalendarDateFields field, int32_t defaultValue) const
Gets the value for a given time field.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
UObject is the common ICU "boilerplate" class.
static const Locale & getDefault(void)
Common methods of getting the current default Locale.
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
TimeZone represents a time zone offset, and also figures out daylight savings.
Base class for 'pure' C++ implementations of uenum api.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
C++ API: Locale ID object.
static Calendar * createInstance(UErrorCode &success)
Creates a Calendar using the default timezone and locale.
UBool fAreFieldsSet
True if the fields are in sync with the currently set time of this Calendar.
Basic definitions for ICU, for both C and C++ APIs.
UDate getTime(UErrorCode &status) const
Gets this Calendar's time as milliseconds.
int32_t fFields[UCAL_FIELD_COUNT]
The time fields containing values into which the millis is computed.
UBool operator!=(const Calendar &that) const
Compares the inequality of two Calendar objects.
EMonths
Useful constants for month.
A Locale object represents a specific geographical, political, or cultural region.
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
int32_t getGregorianMonth() const
Return the month (0-based) on the Gregorian calendar as computed by computeGregorianFields().
int32_t UFieldResolutionTable[12][8]
int8_t UBool
The ICU boolean type.