34 #if !UCONFIG_NO_FORMATTING
44 class ICUServiceFactory;
210 #ifndef U_HIDE_DEPRECATED_API
225 DAY_OF_WEEK_IN_MONTH,
246 #ifndef U_HIDE_DEPRECATED_API
305 virtual Calendar* clone(
void)
const = 0;
397 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
426 static UDate U_EXPORT2 getNow(
void);
556 virtual void add(EDateFields field, int32_t amount,
UErrorCode& status);
580 #ifndef U_HIDE_DEPRECATED_API
681 virtual void roll(EDateFields field, int32_t amount,
UErrorCode& status);
771 virtual int32_t fieldDifference(
UDate when, EDateFields field,
UErrorCode& status);
838 void adoptTimeZone(
TimeZone* value);
847 void setTimeZone(
const TimeZone& zone);
857 const TimeZone& getTimeZone(
void)
const;
891 void setLenient(
UBool lenient);
899 UBool isLenient(
void)
const;
969 #ifndef U_HIDE_DEPRECATED_API
976 void setFirstDayOfWeek(EDaysOfWeek value);
987 #ifndef U_HIDE_DEPRECATED_API
994 EDaysOfWeek getFirstDayOfWeek(
void)
const;
1015 void setMinimalDaysInFirstWeek(uint8_t value);
1026 uint8_t getMinimalDaysInFirstWeek(
void)
const;
1036 virtual int32_t getMinimum(EDateFields field)
const;
1056 virtual int32_t getMaximum(EDateFields field)
const;
1076 virtual int32_t getGreatestMinimum(EDateFields field)
const;
1096 virtual int32_t getLeastMaximum(EDateFields field)
const;
1108 #ifndef U_HIDE_DEPRECATED_API
1123 int32_t getActualMinimum(EDateFields field,
UErrorCode& status)
const;
1142 #ifndef U_HIDE_DEPRECATED_API
1159 int32_t getActualMaximum(EDateFields field,
UErrorCode& status)
const;
1180 #ifndef U_HIDE_DEPRECATED_API
1194 int32_t
get(EDateFields field,
UErrorCode& status)
const;
1212 #ifndef U_HIDE_DEPRECATED_API
1221 UBool isSet(EDateFields field)
const;
1234 #ifndef U_HIDE_DEPRECATED_API
1242 void set(EDateFields field, int32_t value);
1264 void set(int32_t year, int32_t month, int32_t date);
1278 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1293 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1303 #ifndef U_HIDE_DEPRECATED_API
1312 void clear(EDateFields field);
1374 virtual const char * getType()
const = 0;
1428 virtual UBool isWeekend(
void)
const;
1489 virtual void computeTime(
UErrorCode& status);
1502 virtual void computeFields(
UErrorCode& status);
1513 double getTimeInMillis(
UErrorCode& status)
const;
1523 void setTimeInMillis(
double millis,
UErrorCode& status );
1536 #ifndef U_HIDE_DEPRECATED_API
1548 #ifndef U_HIDE_INTERNAL_API
1572 #ifndef U_HIDE_DEPRECATED_API
1582 void internalSet(EDateFields field, int32_t value);
1609 #ifndef U_HIDE_INTERNAL_API
1610 UCAL_LIMIT_MINIMUM = 0,
1611 UCAL_LIMIT_GREATEST_MINIMUM,
1612 UCAL_LIMIT_LEAST_MAXIMUM,
1639 virtual int32_t handleGetLimit(
UCalendarDateFields field, ELimitType limitType)
const = 0;
1664 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1665 UBool useMonth)
const = 0;
1674 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1683 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1694 virtual int32_t handleGetExtendedYear() = 0;
1714 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1716 #ifndef U_HIDE_INTERNAL_API
1723 int32_t computeJulianDay();
1732 int32_t computeMillisInDay();
1743 int32_t computeZoneOffset(
double millis, int32_t millisInDay,
UErrorCode &ec);
1825 #ifndef U_HIDE_INTERNAL_API
1952 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1954 #ifndef U_HIDE_INTERNAL_API
1961 return fGregorianYear;
1970 return fGregorianMonth;
1979 return fGregorianDayOfYear;
1988 return fGregorianDayOfMonth;
1998 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
2008 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
2089 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2092 #ifndef U_HIDE_INTERNAL_API
2123 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2129 int32_t getLocalDOW();
2143 void recalculateStamp();
2182 uint8_t fMinimalDaysInFirstWeek;
2184 int32_t fWeekendOnsetMillis;
2186 int32_t fWeekendCeaseMillis;
2198 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2216 int32_t fGregorianYear;
2223 int32_t fGregorianMonth;
2230 int32_t fGregorianDayOfYear;
2237 int32_t fGregorianDayOfMonth;
2247 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2258 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
2375 friend class CalendarFactory;
2381 friend class CalendarService;
2387 friend class DefaultCalendarFactory;
2394 virtual UBool haveDefaultCentury()
const = 0;
2400 virtual UDate defaultCenturyStart()
const = 0;
2405 virtual int32_t defaultCenturyStartYear()
const = 0;
2415 #ifndef U_HIDE_INTERNAL_API
2439 return createInstance(zone, Locale::getDefault(), errorCode);
2447 roll(field, (int32_t)(up ? +1 : -1), status);
2450 #ifndef U_HIDE_DEPRECATED_API
2469 fFields[field] = value;
2470 fStamp[field] = kInternallySet;
2471 fIsSet[field] =
TRUE;
2475 #ifndef U_HIDE_INTERNAL_API
2476 inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)
2478 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);
UCalendarDateFields
Possible fields in a UCalendar.
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
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.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
int32_t internalGet(UCalendarDateFields field) const
Gets the value for a given time field.
#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 getGregorianDayOfMonth() const
Return the day of month (1-based) on the Gregorian calendar as computed by computeGregorianFields().
int32_t internalGet(UCalendarDateFields field, int32_t defaultValue) const
Gets the value for a given time field.
#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.
int32_t getGregorianMonth() const
Return the month (0-based) on the Gregorian calendar as computed by computeGregorianFields().
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
UCalendarDaysOfWeek
Useful constant for days of week.
int32_t getGregorianYear() const
Return the extended year on the Gregorian calendar as computed by computeGregorianFields().
EAmpm
Useful constants for hour in 12-hour clock.
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.
EDaysOfWeek
Useful constant for days of week.
int32_t getGregorianDayOfYear() const
Return the day of year (1-based) on the Gregorian calendar as computed by computeGregorianFields().
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...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
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.
UBool operator!=(const Calendar &that) const
Compares the inequality of two Calendar objects.
C++ API: Locale ID object.
int32_t internalGet(EDateFields field) const
Gets the value for a given time field.
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.
UObject is the common ICU "boilerplate" class.
int32_t UFieldResolutionTable[12][8]
UBool fAreFieldsSet
True if the fields are in sync with the currently set time of this Calendar.
int8_t UBool
The ICU boolean type.
UDate internalGetTime(void) const
Get the current time without recomputing.
A Locale object represents a specific geographical, political, or cultural region.