Current Path: > > opt > alt > > > libicu > usr > include > unicode > >
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
alphaindex.h | File | 27055 bytes | November 07 2019 06:58:02. | |
appendable.h | File | 8632 bytes | November 07 2019 06:58:02. | |
basictz.h | File | 9055 bytes | November 07 2019 06:58:02. | |
brkiter.h | File | 28303 bytes | November 07 2019 06:58:02. | |
bytestream.h | File | 9767 bytes | November 07 2019 06:58:02. | |
bytestrie.h | File | 19718 bytes | November 07 2019 06:58:02. | |
bytestriebuilder.h | File | 7186 bytes | November 07 2019 06:58:02. | |
calendar.h | File | 107581 bytes | November 07 2019 06:58:02. | |
caniter.h | File | 7550 bytes | November 07 2019 06:58:02. | |
casemap.h | File | 25871 bytes | November 07 2019 06:58:02. | |
char16ptr.h | File | 7331 bytes | November 07 2019 06:58:02. | |
chariter.h | File | 24573 bytes | November 07 2019 06:58:02. | |
choicfmt.h | File | 24418 bytes | November 07 2019 06:58:02. | |
coleitr.h | File | 14033 bytes | November 07 2019 06:58:02. | |
coll.h | File | 56928 bytes | November 07 2019 06:58:02. | |
compactdecimalformat.h | File | 6971 bytes | November 07 2019 06:58:02. | |
curramt.h | File | 3782 bytes | November 07 2019 06:58:02. | |
currpinf.h | File | 7412 bytes | November 07 2019 06:58:02. | |
currunit.h | File | 4082 bytes | November 07 2019 06:58:02. | |
datefmt.h | File | 41334 bytes | November 07 2019 06:58:02. | |
dbbi.h | File | 1133 bytes | November 07 2019 06:58:02. | |
dcfmtsym.h | File | 20584 bytes | November 07 2019 06:58:02. | |
decimfmt.h | File | 89926 bytes | November 07 2019 06:58:02. | |
docmain.h | File | 7123 bytes | November 07 2019 06:58:02. | |
dtfmtsym.h | File | 38548 bytes | November 07 2019 06:58:02. | |
dtintrv.h | File | 3869 bytes | November 07 2019 06:58:02. | |
dtitvfmt.h | File | 47676 bytes | November 07 2019 06:58:02. | |
dtitvinf.h | File | 18902 bytes | November 07 2019 06:58:02. | |
dtptngen.h | File | 25681 bytes | November 07 2019 06:58:02. | |
dtrule.h | File | 8831 bytes | November 07 2019 06:58:02. | |
edits.h | File | 21169 bytes | November 07 2019 06:58:02. | |
enumset.h | File | 2130 bytes | November 07 2019 06:58:02. | |
errorcode.h | File | 4894 bytes | November 07 2019 06:58:02. | |
fieldpos.h | File | 8838 bytes | November 07 2019 06:58:02. | |
filteredbrk.h | File | 5364 bytes | November 07 2019 06:58:02. | |
fmtable.h | File | 24946 bytes | November 07 2019 06:58:02. | |
format.h | File | 12741 bytes | November 07 2019 06:58:02. | |
formattedvalue.h | File | 9963 bytes | November 07 2019 06:58:02. | |
fpositer.h | File | 3047 bytes | November 07 2019 06:58:02. | |
gender.h | File | 3347 bytes | November 07 2019 06:58:02. | |
gregocal.h | File | 32331 bytes | November 07 2019 06:58:02. | |
icudataver.h | File | 1051 bytes | November 07 2019 06:58:02. | |
icuplug.h | File | 12166 bytes | November 07 2019 06:58:02. | |
idna.h | File | 12938 bytes | November 07 2019 06:58:02. | |
listformatter.h | File | 9644 bytes | November 07 2019 06:58:02. | |
localebuilder.h | File | 10792 bytes | November 07 2019 06:58:02. | |
localpointer.h | File | 20159 bytes | November 07 2019 06:58:02. | |
locdspnm.h | File | 7231 bytes | November 07 2019 06:58:02. | |
locid.h | File | 46015 bytes | November 07 2019 06:58:02. | |
measfmt.h | File | 11710 bytes | November 07 2019 06:58:02. | |
measunit.h | File | 90283 bytes | November 07 2019 06:58:02. | |
measure.h | File | 4361 bytes | November 07 2019 06:58:02. | |
messagepattern.h | File | 34460 bytes | November 07 2019 06:58:02. | |
msgfmt.h | File | 45099 bytes | November 07 2019 06:58:02. | |
normalizer2.h | File | 34789 bytes | November 07 2019 06:58:02. | |
normlzr.h | File | 31476 bytes | November 07 2019 06:58:02. | |
nounit.h | File | 2693 bytes | November 07 2019 06:58:02. | |
numberformatter.h | File | 86654 bytes | November 07 2019 06:58:02. | |
numberrangeformatter.h | File | 30653 bytes | November 07 2019 06:58:02. | |
numfmt.h | File | 50530 bytes | November 07 2019 06:58:02. | |
numsys.h | File | 7303 bytes | November 07 2019 06:58:02. | |
parseerr.h | File | 3155 bytes | November 07 2019 06:58:02. | |
parsepos.h | File | 5630 bytes | November 07 2019 06:58:02. | |
platform.h | File | 27754 bytes | November 07 2019 06:58:02. | |
plurfmt.h | File | 25786 bytes | November 07 2019 06:58:02. | |
plurrule.h | File | 18774 bytes | November 07 2019 06:58:02. | |
ptypes.h | File | 3577 bytes | November 07 2019 06:58:02. | |
putil.h | File | 6487 bytes | November 07 2019 06:58:02. | |
rbbi.h | File | 27053 bytes | November 07 2019 06:58:02. | |
rbnf.h | File | 50984 bytes | November 07 2019 06:58:02. | |
rbtz.h | File | 15838 bytes | November 07 2019 06:58:02. | |
regex.h | File | 86320 bytes | November 07 2019 06:58:02. | |
region.h | File | 9342 bytes | November 07 2019 06:58:02. | |
reldatefmt.h | File | 22910 bytes | November 07 2019 06:58:02. | |
rep.h | File | 9726 bytes | November 07 2019 06:58:02. | |
resbund.h | File | 18440 bytes | November 07 2019 06:58:02. | |
schriter.h | File | 6410 bytes | November 07 2019 06:58:02. | |
scientificnumberformatter.h | File | 6474 bytes | November 07 2019 06:58:02. | |
search.h | File | 22742 bytes | November 07 2019 06:58:02. | |
selfmt.h | File | 14579 bytes | November 07 2019 06:58:02. | |
simpleformatter.h | File | 12826 bytes | November 07 2019 06:58:02. | |
simpletz.h | File | 46389 bytes | November 07 2019 06:58:02. | |
smpdtfmt.h | File | 72597 bytes | November 07 2019 06:58:02. | |
sortkey.h | File | 11383 bytes | November 07 2019 06:58:02. | |
std_string.h | File | 1015 bytes | November 07 2019 06:58:02. | |
strenum.h | File | 10279 bytes | November 07 2019 06:58:02. | |
stringoptions.h | File | 5926 bytes | November 07 2019 06:58:02. | |
stringpiece.h | File | 6610 bytes | November 07 2019 06:58:02. | |
stringtriebuilder.h | File | 15636 bytes | November 07 2019 06:58:02. | |
stsearch.h | File | 21801 bytes | November 07 2019 06:58:02. | |
symtable.h | File | 4312 bytes | November 07 2019 06:58:02. | |
tblcoll.h | File | 37272 bytes | November 07 2019 06:58:02. | |
timezone.h | File | 42189 bytes | November 07 2019 06:58:02. | |
tmunit.h | File | 3371 bytes | November 07 2019 06:58:02. | |
tmutamt.h | File | 4918 bytes | November 07 2019 06:58:02. | |
tmutfmt.h | File | 7977 bytes | November 07 2019 06:58:02. | |
translit.h | File | 67339 bytes | November 07 2019 06:58:02. | |
tzfmt.h | File | 43846 bytes | November 07 2019 06:58:02. | |
tznames.h | File | 17190 bytes | November 07 2019 06:58:02. | |
tzrule.h | File | 36170 bytes | November 07 2019 06:58:02. | |
tztrans.h | File | 6214 bytes | November 07 2019 06:58:02. | |
ubidi.h | File | 91711 bytes | November 07 2019 06:58:02. | |
ubiditransform.h | File | 12950 bytes | November 07 2019 06:58:02. | |
ubrk.h | File | 24547 bytes | November 07 2019 06:58:02. | |
ucal.h | File | 56876 bytes | November 07 2019 06:58:02. | |
ucasemap.h | File | 15546 bytes | November 07 2019 06:58:02. | |
ucat.h | File | 5484 bytes | November 07 2019 06:58:02. | |
uchar.h | File | 144035 bytes | November 07 2019 06:58:02. | |
ucharstrie.h | File | 21569 bytes | November 07 2019 06:58:02. | |
ucharstriebuilder.h | File | 7316 bytes | November 07 2019 06:58:02. | |
uchriter.h | File | 13457 bytes | November 07 2019 06:58:02. | |
uclean.h | File | 11474 bytes | November 07 2019 06:58:02. | |
ucnv.h | File | 85085 bytes | November 07 2019 06:58:02. | |
ucnv_cb.h | File | 6748 bytes | November 07 2019 06:58:02. | |
ucnv_err.h | File | 21492 bytes | November 07 2019 06:58:02. | |
ucnvsel.h | File | 6283 bytes | November 07 2019 06:58:02. | |
ucol.h | File | 62864 bytes | November 07 2019 06:58:02. | |
ucoleitr.h | File | 9684 bytes | November 07 2019 06:58:02. | |
uconfig.h | File | 12338 bytes | November 07 2019 06:58:02. | |
ucpmap.h | File | 5709 bytes | November 07 2019 06:58:02. | |
ucptrie.h | File | 22824 bytes | November 07 2019 06:58:02. | |
ucsdet.h | File | 15018 bytes | November 07 2019 06:58:02. | |
ucurr.h | File | 16536 bytes | November 07 2019 06:58:02. | |
udat.h | File | 62267 bytes | November 07 2019 06:58:02. | |
udata.h | File | 15905 bytes | November 07 2019 06:58:02. | |
udateintervalformat.h | File | 10272 bytes | November 07 2019 06:58:02. | |
udatpg.h | File | 26564 bytes | November 07 2019 06:58:02. | |
udisplaycontext.h | File | 6029 bytes | November 07 2019 06:58:02. | |
uenum.h | File | 7970 bytes | November 07 2019 06:58:02. | |
ufieldpositer.h | File | 4461 bytes | November 07 2019 06:58:02. | |
uformattable.h | File | 11198 bytes | November 07 2019 06:58:02. | |
uformattedvalue.h | File | 12430 bytes | November 07 2019 06:58:02. | |
ugender.h | File | 2052 bytes | November 07 2019 06:58:02. | |
uidna.h | File | 34169 bytes | November 07 2019 06:58:02. | |
uiter.h | File | 23319 bytes | November 07 2019 06:58:02. | |
uldnames.h | File | 10702 bytes | November 07 2019 06:58:02. | |
ulistformatter.h | File | 9043 bytes | November 07 2019 06:58:02. | |
uloc.h | File | 51971 bytes | November 07 2019 06:58:02. | |
ulocdata.h | File | 11533 bytes | November 07 2019 06:58:02. | |
umachine.h | File | 13509 bytes | November 07 2019 06:58:02. | |
umisc.h | File | 1365 bytes | November 07 2019 06:58:02. | |
umsg.h | File | 24812 bytes | November 07 2019 06:58:02. | |
umutablecptrie.h | File | 8477 bytes | November 07 2019 06:58:02. | |
unifilt.h | File | 3716 bytes | November 07 2019 06:58:02. | |
unifunct.h | File | 4079 bytes | November 07 2019 06:58:02. | |
unimatch.h | File | 6184 bytes | November 07 2019 06:58:02. | |
unirepl.h | File | 3403 bytes | November 07 2019 06:58:02. | |
uniset.h | File | 66440 bytes | November 07 2019 06:58:02. | |
unistr.h | File | 174477 bytes | November 07 2019 06:58:02. | |
unorm.h | File | 20938 bytes | November 07 2019 06:58:02. | |
unorm2.h | File | 25254 bytes | November 07 2019 06:58:02. | |
unum.h | File | 54832 bytes | November 07 2019 06:58:02. | |
unumberformatter.h | File | 25795 bytes | November 07 2019 06:58:02. | |
unumsys.h | File | 7387 bytes | November 07 2019 06:58:02. | |
uobject.h | File | 11106 bytes | November 07 2019 06:58:02. | |
upluralrules.h | File | 8068 bytes | November 07 2019 06:58:02. | |
uregex.h | File | 73784 bytes | November 07 2019 06:58:02. | |
uregion.h | File | 10073 bytes | November 07 2019 06:58:02. | |
ureldatefmt.h | File | 17670 bytes | November 07 2019 06:58:02. | |
urename.h | File | 134551 bytes | November 07 2019 06:58:02. | |
urep.h | File | 5507 bytes | November 07 2019 06:58:02. | |
ures.h | File | 37415 bytes | November 07 2019 06:58:02. | |
uscript.h | File | 27510 bytes | November 07 2019 06:58:02. | |
usearch.h | File | 39038 bytes | November 07 2019 06:58:02. | |
uset.h | File | 40958 bytes | November 07 2019 06:58:02. | |
usetiter.h | File | 9719 bytes | November 07 2019 06:58:02. | |
ushape.h | File | 18432 bytes | November 07 2019 06:58:02. | |
uspoof.h | File | 67613 bytes | November 07 2019 06:58:02. | |
usprep.h | File | 8331 bytes | November 07 2019 06:58:02. | |
ustdio.h | File | 39469 bytes | November 07 2019 06:58:02. | |
ustream.h | File | 1844 bytes | November 07 2019 06:58:02. | |
ustring.h | File | 74211 bytes | November 07 2019 06:58:02. | |
ustringtrie.h | File | 3224 bytes | November 07 2019 06:58:02. | |
utext.h | File | 59505 bytes | November 07 2019 06:58:02. | |
utf.h | File | 8046 bytes | November 07 2019 06:58:02. | |
utf16.h | File | 22866 bytes | November 07 2019 06:58:02. | |
utf32.h | File | 763 bytes | November 07 2019 06:58:02. | |
utf8.h | File | 30682 bytes | November 07 2019 06:58:02. | |
utf_old.h | File | 44827 bytes | November 07 2019 06:58:02. | |
utmscale.h | File | 14113 bytes | November 07 2019 06:58:02. | |
utrace.h | File | 14219 bytes | November 07 2019 06:58:02. | |
utrans.h | File | 26157 bytes | November 07 2019 06:58:02. | |
utypes.h | File | 31108 bytes | November 07 2019 06:58:02. | |
uvernum.h | File | 6832 bytes | November 07 2019 06:58:02. | |
uversion.h | File | 6865 bytes | November 07 2019 06:58:02. | |
vtzone.h | File | 20651 bytes | November 07 2019 06:58:02. |
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 1997-2013, International Business Machines Corporation and others. * All Rights Reserved. ******************************************************************************** * * File GREGOCAL.H * * Modification History: * * Date Name Description * 04/22/97 aliu Overhauled header. * 07/28/98 stephen Sync with JDK 1.2 * 09/04/98 stephen Re-sync with JDK 8/31 putback * 09/14/98 stephen Changed type of kOneDay, kOneWeek to double. * Fixed bug in roll() * 10/15/99 aliu Fixed j31, incorrect WEEK_OF_YEAR computation. * Added documentation of WEEK_OF_YEAR computation. * 10/15/99 aliu Fixed j32, cannot set date to Feb 29 2000 AD. * {JDK bug 4210209 4209272} * 11/07/2003 srl Update, clean up documentation. ******************************************************************************** */ #ifndef GREGOCAL_H #define GREGOCAL_H #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #include "unicode/calendar.h" /** * \file * \brief C++ API: Concrete class which provides the standard calendar. */ U_NAMESPACE_BEGIN /** * Concrete class which provides the standard calendar used by most of the world. * <P> * The standard (Gregorian) calendar has 2 eras, BC and AD. * <P> * This implementation handles a single discontinuity, which corresponds by default to * the date the Gregorian calendar was originally instituted (October 15, 1582). Not all * countries adopted the Gregorian calendar then, so this cutover date may be changed by * the caller. * <P> * Prior to the institution of the Gregorian Calendar, New Year's Day was March 25. To * avoid confusion, this Calendar always uses January 1. A manual adjustment may be made * if desired for dates that are prior to the Gregorian changeover and which fall * between January 1 and March 24. * * <p>Values calculated for the <code>WEEK_OF_YEAR</code> field range from 1 to * 53. Week 1 for a year is the first week that contains at least * <code>getMinimalDaysInFirstWeek()</code> days from that year. It thus * depends on the values of <code>getMinimalDaysInFirstWeek()</code>, * <code>getFirstDayOfWeek()</code>, and the day of the week of January 1. * Weeks between week 1 of one year and week 1 of the following year are * numbered sequentially from 2 to 52 or 53 (as needed). * * <p>For example, January 1, 1998 was a Thursday. If * <code>getFirstDayOfWeek()</code> is <code>MONDAY</code> and * <code>getMinimalDaysInFirstWeek()</code> is 4 (these are the values * reflecting ISO 8601 and many national standards), then week 1 of 1998 starts * on December 29, 1997, and ends on January 4, 1998. If, however, * <code>getFirstDayOfWeek()</code> is <code>SUNDAY</code>, then week 1 of 1998 * starts on January 4, 1998, and ends on January 10, 1998; the first three days * of 1998 then are part of week 53 of 1997. * * <p>Example for using GregorianCalendar: * <pre> * \code * // get the supported ids for GMT-08:00 (Pacific Standard Time) * UErrorCode success = U_ZERO_ERROR; * const StringEnumeration *ids = TimeZone::createEnumeration(-8 * 60 * 60 * 1000); * // if no ids were returned, something is wrong. get out. * if (ids == 0 || ids->count(success) == 0) { * return; * } * * // begin output * cout << "Current Time" << endl; * * // create a Pacific Standard Time time zone * SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids->unext(NULL, success))); * * // set up rules for daylight savings time * pdt->setStartRule(UCAL_MARCH, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000); * pdt->setEndRule(UCAL_NOVEMBER, 2, UCAL_SUNDAY, 2 * 60 * 60 * 1000); * * // create a GregorianCalendar with the Pacific Daylight time zone * // and the current date and time * Calendar* calendar = new GregorianCalendar( pdt, success ); * * // print out a bunch of interesting things * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl; * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl; * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl; * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl; * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl; * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl; * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl; * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl; * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl; * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl; * * cout << "Current Time, with hour reset to 3" << endl; * calendar->clear(UCAL_HOUR_OF_DAY); // so doesn't override * calendar->set(UCAL_HOUR, 3); * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl; * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl; * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl; * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl; * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl; * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl; * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl; * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl; * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl; // in hours * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl; // in hours * * if (U_FAILURE(success)) { * cout << "An error occured. success=" << u_errorName(success) << endl; * } * * delete ids; * delete calendar; // also deletes pdt * \endcode * </pre> * @stable ICU 2.0 */ class U_I18N_API GregorianCalendar: public Calendar { public: /** * Useful constants for GregorianCalendar and TimeZone. * @stable ICU 2.0 */ enum EEras { BC, AD }; /** * Constructs a default GregorianCalendar using the current time in the default time * zone with the default locale. * * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(UErrorCode& success); /** * Constructs a GregorianCalendar based on the current time in the given time zone * with the default locale. Clients are no longer responsible for deleting the given * time zone object after it's adopted. * * @param zoneToAdopt The given timezone. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(TimeZone* zoneToAdopt, UErrorCode& success); /** * Constructs a GregorianCalendar based on the current time in the given time zone * with the default locale. * * @param zone The given timezone. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(const TimeZone& zone, UErrorCode& success); /** * Constructs a GregorianCalendar based on the current time in the default time zone * with the given locale. * * @param aLocale The given locale. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(const Locale& aLocale, UErrorCode& success); /** * Constructs a GregorianCalendar based on the current time in the given time zone * with the given locale. Clients are no longer responsible for deleting the given * time zone object after it's adopted. * * @param zoneToAdopt The given timezone. * @param aLocale The given locale. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success); /** * Constructs a GregorianCalendar based on the current time in the given time zone * with the given locale. * * @param zone The given timezone. * @param aLocale The given locale. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success); /** * Constructs a GregorianCalendar with the given AD date set in the default time * zone with the default locale. * * @param year The value used to set the YEAR time field in the calendar. * @param month The value used to set the MONTH time field in the calendar. Month * value is 0-based. e.g., 0 for January. * @param date The value used to set the DATE time field in the calendar. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(int32_t year, int32_t month, int32_t date, UErrorCode& success); /** * Constructs a GregorianCalendar with the given AD date and time set for the * default time zone with the default locale. * * @param year The value used to set the YEAR time field in the calendar. * @param month The value used to set the MONTH time field in the calendar. Month * value is 0-based. e.g., 0 for January. * @param date The value used to set the DATE time field in the calendar. * @param hour The value used to set the HOUR_OF_DAY time field in the calendar. * @param minute The value used to set the MINUTE time field in the calendar. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode& success); /** * Constructs a GregorianCalendar with the given AD date and time set for the * default time zone with the default locale. * * @param year The value used to set the YEAR time field in the calendar. * @param month The value used to set the MONTH time field in the calendar. Month * value is 0-based. e.g., 0 for January. * @param date The value used to set the DATE time field in the calendar. * @param hour The value used to set the HOUR_OF_DAY time field in the calendar. * @param minute The value used to set the MINUTE time field in the calendar. * @param second The value used to set the SECOND time field in the calendar. * @param success Indicates the status of GregorianCalendar object construction. * Returns U_ZERO_ERROR if constructed successfully. * @stable ICU 2.0 */ GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode& success); /** * Destructor * @stable ICU 2.0 */ virtual ~GregorianCalendar(); /** * Copy constructor * @param source the object to be copied. * @stable ICU 2.0 */ GregorianCalendar(const GregorianCalendar& source); /** * Default assignment operator * @param right the object to be copied. * @stable ICU 2.0 */ GregorianCalendar& operator=(const GregorianCalendar& right); /** * Create and return a polymorphic copy of this calendar. * @return return a polymorphic copy of this calendar. * @stable ICU 2.0 */ virtual Calendar* clone(void) const; /** * Sets the GregorianCalendar change date. This is the point when the switch from * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October * 15, 1582. Previous to this time and date will be Julian dates. * * @param date The given Gregorian cutover date. * @param success Output param set to success/failure code on exit. * @stable ICU 2.0 */ void setGregorianChange(UDate date, UErrorCode& success); /** * Gets the Gregorian Calendar change date. This is the point when the switch from * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October * 15, 1582. Previous to this time and date will be Julian dates. * * @return The Gregorian cutover time for this calendar. * @stable ICU 2.0 */ UDate getGregorianChange(void) const; /** * Return true if the given year is a leap year. Determination of whether a year is * a leap year is actually very complicated. We do something crude and mostly * correct here, but for a real determination you need a lot of contextual * information. For example, in Sweden, the change from Julian to Gregorian happened * in a complex way resulting in missed leap years and double leap years between * 1700 and 1753. Another example is that after the start of the Julian calendar in * 45 B.C., the leap years did not regularize until 8 A.D. This method ignores these * quirks, and pays attention only to the Julian onset date and the Gregorian * cutover (which can be changed). * * @param year The given year. * @return True if the given year is a leap year; false otherwise. * @stable ICU 2.0 */ UBool isLeapYear(int32_t year) const; /** * Returns TRUE if the given Calendar object is equivalent to this * one. Calendar override. * * @param other the Calendar to be compared with this Calendar * @stable ICU 2.4 */ virtual UBool isEquivalentTo(const Calendar& other) const; /** * (Overrides Calendar) Rolls up or down by the given amount in the specified field. * For more information, see the documentation for Calendar::roll(). * * @param field The time field. * @param amount Indicates amount to roll. * @param status Output param set to success/failure code on exit. If any value * previously set in the time field is invalid, this will be set to * an error status. * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. */ virtual void roll(EDateFields field, int32_t amount, UErrorCode& status); /** * (Overrides Calendar) Rolls up or down by the given amount in the specified field. * For more information, see the documentation for Calendar::roll(). * * @param field The time field. * @param amount Indicates amount to roll. * @param status Output param set to success/failure code on exit. If any value * previously set in the time field is invalid, this will be set to * an error status. * @stable ICU 2.6. */ virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status); #ifndef U_HIDE_DEPRECATED_API /** * Return the minimum value that this field could have, given the current date. * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum(). * @param field the time field. * @return the minimum value that this field could have, given the current date. * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead. */ int32_t getActualMinimum(EDateFields field) const; /** * Return the minimum value that this field could have, given the current date. * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum(). * @param field the time field. * @param status * @return the minimum value that this field could have, given the current date. * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead. (Added to ICU 3.0 for signature consistency) */ int32_t getActualMinimum(EDateFields field, UErrorCode& status) const; #endif /* U_HIDE_DEPRECATED_API */ /** * Return the minimum value that this field could have, given the current date. * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum(). * @param field the time field. * @param status error result. * @return the minimum value that this field could have, given the current date. * @stable ICU 3.0 */ int32_t getActualMinimum(UCalendarDateFields field, UErrorCode &status) const; #ifndef U_HIDE_DEPRECATED_API /** * Return the maximum value that this field could have, given the current date. * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar, * for some years the actual maximum for MONTH is 12, and for others 13. * @param field the time field. * @return the maximum value that this field could have, given the current date. * @deprecated ICU 2.6. Use getActualMaximum(UCalendarDateFields field) instead. */ int32_t getActualMaximum(EDateFields field) const; #endif /* U_HIDE_DEPRECATED_API */ /** * Return the maximum value that this field could have, given the current date. * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar, * for some years the actual maximum for MONTH is 12, and for others 13. * @param field the time field. * @param status returns any errors that may result from this function call. * @return the maximum value that this field could have, given the current date. * @stable ICU 2.6 */ virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const; /** * (Overrides Calendar) Return true if the current date for this Calendar is in * Daylight Savings Time. Recognizes DST_OFFSET, if it is set. * * @param status Fill-in parameter which receives the status of this operation. * @return True if the current date for this Calendar is in Daylight Savings Time, * false, otherwise. * @stable ICU 2.0 */ virtual UBool inDaylightTime(UErrorCode& status) const; public: /** * Override Calendar Returns a unique class ID POLYMORPHICALLY. Pure virtual * override. This method is to implement a simple version of RTTI, since not all C++ * compilers support genuine RTTI. Polymorphic operator==() and clone() methods call * this method. * * @return The class ID for this object. All objects of a given class have the * same class ID. Objects of other classes have different class IDs. * @stable ICU 2.0 */ virtual UClassID getDynamicClassID(void) const; /** * Return the class ID for this class. This is useful only for comparing to a return * value from getDynamicClassID(). For example: * * Base* polymorphic_pointer = createPolymorphicObject(); * if (polymorphic_pointer->getDynamicClassID() == * Derived::getStaticClassID()) ... * * @return The class ID for all objects of this class. * @stable ICU 2.0 */ static UClassID U_EXPORT2 getStaticClassID(void); /** * Returns the calendar type name string for this Calendar object. * The returned string is the legacy ICU calendar attribute value, * for example, "gregorian" or "japanese". * * For more details see the Calendar::getType() documentation. * * @return legacy calendar type name string * @stable ICU 49 */ virtual const char * getType() const; private: GregorianCalendar(); // default constructor not implemented protected: /** * Return the ERA. We need a special method for this because the * default ERA is AD, but a zero (unset) ERA is BC. * @return the ERA. * @internal */ virtual int32_t internalGetEra() const; /** * Return the Julian day number of day before the first day of the * given month in the given extended year. Subclasses should override * this method to implement their calendar system. * @param eyear the extended year * @param month the zero-based month, or 0 if useMonth is false * @param useMonth if false, compute the day before the first day of * the given year, otherwise, compute the day before the first day of * the given month * @return the Julian day number of the day before the first * day of the given month and year * @internal */ virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; /** * Subclasses may override this. This method calls * handleGetMonthLength() to obtain the calendar-specific month * length. * @param bestField which field to use to calculate the date * @return julian day specified by calendar fields. * @internal */ virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField) ; /** * Return the number of days in the given month of the given extended * year of this calendar system. Subclasses should override this * method if they can provide a more correct or more efficient * implementation than the default implementation in Calendar. * @internal */ virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; /** * Return the number of days in the given extended year of this * calendar system. Subclasses should override this method if they can * provide a more correct or more efficient implementation than the * default implementation in Calendar. * @stable ICU 2.0 */ virtual int32_t handleGetYearLength(int32_t eyear) const; /** * return the length of the given month. * @param month the given month. * @return the length of the given month. * @internal */ virtual int32_t monthLength(int32_t month) const; /** * return the length of the month according to the given year. * @param month the given month. * @param year the given year. * @return the length of the month * @internal */ virtual int32_t monthLength(int32_t month, int32_t year) const; #ifndef U_HIDE_INTERNAL_API /** * return the length of the given year. * @param year the given year. * @return the length of the given year. * @internal */ int32_t yearLength(int32_t year) const; /** * return the length of the year field. * @return the length of the year field * @internal */ int32_t yearLength(void) const; /** * After adjustments such as add(MONTH), add(YEAR), we don't want the * month to jump around. E.g., we don't want Jan 31 + 1 month to go to Mar * 3, we want it to go to Feb 28. Adjustments which might run into this * problem call this method to retain the proper month. * @internal */ void pinDayOfMonth(void); #endif /* U_HIDE_INTERNAL_API */ /** * Return the day number with respect to the epoch. January 1, 1970 (Gregorian) * is day zero. * @param status Fill-in parameter which receives the status of this operation. * @return the day number with respect to the epoch. * @internal */ virtual UDate getEpochDay(UErrorCode& status); /** * Subclass API for defining limits of different types. * Subclasses must implement this method to return limits for the * following fields: * * <pre>UCAL_ERA * UCAL_YEAR * UCAL_MONTH * UCAL_WEEK_OF_YEAR * UCAL_WEEK_OF_MONTH * UCAL_DATE (DAY_OF_MONTH on Java) * UCAL_DAY_OF_YEAR * UCAL_DAY_OF_WEEK_IN_MONTH * UCAL_YEAR_WOY * UCAL_EXTENDED_YEAR</pre> * * @param field one of the above field numbers * @param limitType one of <code>MINIMUM</code>, <code>GREATEST_MINIMUM</code>, * <code>LEAST_MAXIMUM</code>, or <code>MAXIMUM</code> * @internal */ virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; /** * Return the extended year defined by the current fields. This will * use the UCAL_EXTENDED_YEAR field or the UCAL_YEAR and supra-year fields (such * as UCAL_ERA) specific to the calendar system, depending on which set of * fields is newer. * @return the extended year * @internal */ virtual int32_t handleGetExtendedYear(); /** * Subclasses may override this to convert from week fields * (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case * where YEAR, EXTENDED_YEAR are not set. * The Gregorian implementation assumes a yearWoy in gregorian format, according to the current era. * @return the extended year, UCAL_EXTENDED_YEAR * @internal */ virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy); /** * Subclasses may override this method to compute several fields * specific to each calendar system. These are: * * <ul><li>ERA * <li>YEAR * <li>MONTH * <li>DAY_OF_MONTH * <li>DAY_OF_YEAR * <li>EXTENDED_YEAR</ul> * * <p>The GregorianCalendar implementation implements * a calendar with the specified Julian/Gregorian cutover date. * @internal */ virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); private: /** * Compute the julian day number of the given year. * @param isGregorian if true, using Gregorian calendar, otherwise using Julian calendar * @param year the given year. * @param isLeap true if the year is a leap year. * @return */ static double computeJulianDayOfYear(UBool isGregorian, int32_t year, UBool& isLeap); /** * Validates the values of the set time fields. True if they're all valid. * @return True if the set time fields are all valid. */ UBool validateFields(void) const; /** * Validates the value of the given time field. True if it's valid. */ UBool boundsCheck(int32_t value, UCalendarDateFields field) const; /** * Return the pseudo-time-stamp for two fields, given their * individual pseudo-time-stamps. If either of the fields * is unset, then the aggregate is unset. Otherwise, the * aggregate is the later of the two stamps. * @param stamp_a One given field. * @param stamp_b Another given field. * @return the pseudo-time-stamp for two fields */ int32_t aggregateStamp(int32_t stamp_a, int32_t stamp_b); /** * The point at which the Gregorian calendar rules are used, measured in * milliseconds from the standard epoch. Default is October 15, 1582 * (Gregorian) 00:00:00 UTC, that is, October 4, 1582 (Julian) is followed * by October 15, 1582 (Gregorian). This corresponds to Julian day number * 2299161. This is measured from the standard epoch, not in Julian Days. */ UDate fGregorianCutover; /** * Julian day number of the Gregorian cutover */ int32_t fCutoverJulianDay; /** * Midnight, local time (using this Calendar's TimeZone) at or before the * gregorianCutover. This is a pure date value with no time of day or * timezone component. */ UDate fNormalizedGregorianCutover;// = gregorianCutover; /** * The year of the gregorianCutover, with 0 representing * 1 BC, -1 representing 2 BC, etc. */ int32_t fGregorianCutoverYear;// = 1582; /** * The year of the gregorianCutover, with 0 representing * 1 BC, -1 representing 2 BC, etc. */ int32_t fGregorianCutoverJulianDay;// = 2299161; /** * Converts time as milliseconds to Julian date. The Julian date used here is not a * true Julian date, since it is measured from midnight, not noon. * * @param millis The given milliseconds. * @return The Julian date number. */ static double millisToJulianDay(UDate millis); /** * Converts Julian date to time as milliseconds. The Julian date used here is not a * true Julian date, since it is measured from midnight, not noon. * * @param julian The given Julian date number. * @return Time as milliseconds. */ static UDate julianDayToMillis(double julian); /** * Used by handleComputeJulianDay() and handleComputeMonthStart(). * Temporary field indicating whether the calendar is currently Gregorian as opposed to Julian. */ UBool fIsGregorian; /** * Used by handleComputeJulianDay() and handleComputeMonthStart(). * Temporary field indicating that the sense of the gregorian cutover should be inverted * to handle certain calculations on and around the cutover date. */ UBool fInvertGregorian; public: // internal implementation /** * @return TRUE if this calendar has the notion of a default century * @internal */ virtual UBool haveDefaultCentury() const; /** * @return the start of the default century * @internal */ virtual UDate defaultCenturyStart() const; /** * @return the beginning year of the default century * @internal */ virtual int32_t defaultCenturyStartYear() const; }; U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // _GREGOCAL //eof
SILENT KILLER Tool