Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: MacRuby/MacRuby
...
head fork: MacRuby/MacRuby
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 128 files changed
  • 0 commit comments
  • 1 contributor
Commits on Dec 09, 2010
Laurent Sansonetti create branch for ICU embedded work fbb6181
Laurent Sansonetti build/link ICU statically (doesn't work yet, alas...) - make sure you…
… download icu4c-4_4_2-src.tgz into the main directory

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/icu-embedded@5001 23306eb0-4c56-4727-a40e-e92c0eb68959
eae6d04
Showing with 0 additions and 26,255 deletions.
  1. +0 −210 icu-1060/unicode/basictz.h
  2. +0 −557 icu-1060/unicode/brkiter.h
  3. +0 −2,170 icu-1060/unicode/calendar.h
  4. +0 −201 icu-1060/unicode/caniter.h
  5. +0 −716 icu-1060/unicode/chariter.h
  6. +0 −746 icu-1060/unicode/choicfmt.h
  7. +0 −400 icu-1060/unicode/coleitr.h
  8. +0 −1,035 icu-1060/unicode/coll.h
  9. +0 −130 icu-1060/unicode/curramt.h
  10. +0 −117 icu-1060/unicode/currunit.h
  11. +0 −700 icu-1060/unicode/datefmt.h
  12. +0 −41 icu-1060/unicode/dbbi.h
  13. +0 −370 icu-1060/unicode/dcfmtsym.h
  14. +0 −1,901 icu-1060/unicode/decimfmt.h
  15. +0 −202 icu-1060/unicode/docmain.h
  16. +0 −721 icu-1060/unicode/dtfmtsym.h
  17. +0 −159 icu-1060/unicode/dtintrv.h
  18. +0 −949 icu-1060/unicode/dtitvfmt.h
  19. +0 −528 icu-1060/unicode/dtitvinf.h
  20. +0 −423 icu-1060/unicode/dtptngen.h
  21. +0 −250 icu-1060/unicode/dtrule.h
  22. +0 −291 icu-1060/unicode/fieldpos.h
  23. +0 −591 icu-1060/unicode/fmtable.h
  24. +0 −296 icu-1060/unicode/format.h
  25. +0 −823 icu-1060/unicode/gregocal.h
  26. +0 −765 icu-1060/unicode/locid.h
  27. +0 −77 icu-1060/unicode/measfmt.h
  28. +0 −71 icu-1060/unicode/measunit.h
  29. +0 −137 icu-1060/unicode/measure.h
  30. +0 −940 icu-1060/unicode/msgfmt.h
  31. +0 −823 icu-1060/unicode/normlzr.h
  32. +0 −886 icu-1060/unicode/numfmt.h
  33. +0 −92 icu-1060/unicode/parseerr.h
  34. +0 −230 icu-1060/unicode/parsepos.h
  35. +0 −316 icu-1060/unicode/platform.h
  36. +0 −541 icu-1060/unicode/plurfmt.h
  37. +0 −291 icu-1060/unicode/plurrule.h
  38. +0 −273 icu-1060/unicode/ppalmos.h
  39. +0 −184 icu-1060/unicode/putil.h
  40. +0 −311 icu-1060/unicode/pwin32.h
  41. +0 −722 icu-1060/unicode/rbbi.h
  42. +0 −1,049 icu-1060/unicode/rbnf.h
  43. +0 −361 icu-1060/unicode/rbtz.h
  44. +0 −1,232 icu-1060/unicode/regex.h
  45. +0 −259 icu-1060/unicode/rep.h
  46. +0 −485 icu-1060/unicode/resbund.h
  47. +0 −187 icu-1060/unicode/schriter.h
  48. +0 −569 icu-1060/unicode/search.h
  49. +0 −927 icu-1060/unicode/simpletz.h
Sorry, we could not display the entire diff because it was too big.
View
210 icu-1060/unicode/basictz.h
@@ -1,210 +0,0 @@
-/*
-*******************************************************************************
-* Copyright (C) 2007-2008, International Business Machines Corporation and *
-* others. All Rights Reserved. *
-*******************************************************************************
-*/
-#ifndef BASICTZ_H
-#define BASICTZ_H
-
-/**
- * \file
- * \brief C++ API: ICU TimeZone base class
- */
-
-#include "unicode/utypes.h"
-
-#if !UCONFIG_NO_FORMATTING
-
-#include "unicode/timezone.h"
-#include "unicode/tzrule.h"
-#include "unicode/tztrans.h"
-
-U_NAMESPACE_BEGIN
-
-// forward declarations
-class UVector;
-
-/**
- * <code>BasicTimeZone</code> is an abstract class extending <code>TimeZone</code>.
- * This class provides some additional methods to access time zone transitions and rules.
- * All ICU <code>TimeZone</code> concrete subclasses extend this class.
- * @stable ICU 4.0
- */
-class U_I18N_API BasicTimeZone: public TimeZone {
-public:
- /**
- * Destructor.
- * @stable ICU 4.0
- */
- virtual ~BasicTimeZone();
-
- /**
- * Gets the first time zone transition after the base time.
- * @param base The base time.
- * @param inclusive Whether the base time is inclusive or not.
- * @param result Receives the first transition after the base time.
- * @return TRUE if the transition is found.
- * @stable ICU 4.0
- */
- virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/ = 0;
-
- /**
- * Gets the most recent time zone transition before the base time.
- * @param base The base time.
- * @param inclusive Whether the base time is inclusive or not.
- * @param result Receives the most recent transition before the base time.
- * @return TRUE if the transition is found.
- * @stable ICU 4.0
- */
- virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/ = 0;
-
- /**
- * Checks if the time zone has equivalent transitions in the time range.
- * This method returns true when all of transition times, from/to standard
- * offsets and DST savings used by this time zone match the other in the
- * time range.
- * @param tz The <code>BasicTimeZone</code> object to be compared with.
- * @param start The start time of the evaluated time range (inclusive)
- * @param end The end time of the evaluated time range (inclusive)
- * @param ignoreDstAmount
- * When true, any transitions with only daylight saving amount
- * changes will be ignored, except either of them is zero.
- * For example, a transition from rawoffset 3:00/dstsavings 1:00
- * to rawoffset 2:00/dstsavings 2:00 is excluded from the comparison,
- * but a transtion from rawoffset 2:00/dstsavings 1:00 to
- * rawoffset 3:00/dstsavings 0:00 is included.
- * @param ec Output param to filled in with a success or an error.
- * @return true if the other time zone has the equivalent transitions in the
- * time range.
- * @stable ICU 4.0
- */
- virtual UBool hasEquivalentTransitions(/*const*/ BasicTimeZone& tz, UDate start, UDate end,
- UBool ignoreDstAmount, UErrorCode& ec) /*const*/;
-
- /**
- * Returns the number of <code>TimeZoneRule</code>s which represents time transitions,
- * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except
- * <code>InitialTimeZoneRule</code>. The return value range is 0 or any positive value.
- * @param status Receives error status code.
- * @return The number of <code>TimeZoneRule</code>s representing time transitions.
- * @stable ICU 4.0
- */
- virtual int32_t countTransitionRules(UErrorCode& status) /*const*/ = 0;
-
- /**
- * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code>
- * which represent time transitions for this time zone. On successful return,
- * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and
- * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code>
- * instances up to the size specified by trscount. The results are referencing the
- * rule instance held by this time zone instance. Therefore, after this time zone
- * is destructed, they are no longer available.
- * @param initial Receives the initial timezone rule
- * @param trsrules Receives the timezone transition rules
- * @param trscount On input, specify the size of the array 'transitions' receiving
- * the timezone transition rules. On output, actual number of
- * rules filled in the array will be set.
- * @param status Receives error status code.
- * @stable ICU 4.0
- */
- virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
- const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) /*const*/ = 0;
-
- /**
- * Gets the set of time zone rules valid at the specified time. Some known external time zone
- * implementations are not capable to handle historic time zone rule changes. Also some
- * implementations can only handle certain type of rule definitions.
- * If this time zone does not use any daylight saving time within about 1 year from the specified
- * time, only the <code>InitialTimeZone</code> is returned. Otherwise, the rule for standard
- * time and daylight saving time transitions are returned in addition to the
- * <code>InitialTimeZoneRule</code>. The standard and daylight saving time transition rules are
- * represented by <code>AnnualTimeZoneRule</code> with <code>DateTimeRule::DOW</code> for its date
- * rule and <code>DateTimeRule::WALL_TIME</code> for its time rule. Because daylight saving time
- * rule is changing time to time in many time zones and also mapping a transition time rule to
- * different type is lossy transformation, the set of rules returned by this method may be valid
- * for short period of time.
- * The time zone rule objects returned by this method is owned by the caller, so the caller is
- * responsible for deleting them after use.
- * @param date The date used for extracting time zone rules.
- * @param initial Receives the <code>InitialTimeZone</code>, always not NULL.
- * @param std Receives the <code>AnnualTimeZoneRule</code> for standard time transitions.
- * When this time time zone does not observe daylight saving times around the
- * specified date, NULL is set.
- * @param dst Receives the <code>AnnualTimeZoneRule</code> for daylight saving time
- * transitions. When this time zone does not observer daylight saving times
- * around the specified date, NULL is set.
- * @param status Receives error status code.
- * @stable ICU 4.0
- */
- virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initial,
- AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& status) /*const*/;
-
-
- /**
- * The time type option bit flags used by getOffsetFromLocal
- * @internal
- */
- enum {
- kStandard = 0x01,
- kDaylight = 0x03,
- kFormer = 0x04,
- kLatter = 0x0C
- };
-
- /**
- * Get time zone offsets from local wall time.
- * @internal
- */
- virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
- int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) /*const*/;
-
-protected:
-
- /**
- * The time type option bit masks used by getOffsetFromLocal
- * @internal
- */
- enum {
- kStdDstMask = kDaylight,
- kFormerLatterMask = kLatter
- };
-
- /**
- * Default constructor.
- * @stable ICU 4.0
- */
- BasicTimeZone();
-
- /**
- * Construct a timezone with a given ID.
- * @param id a system time zone ID
- * @stable ICU 4.0
- */
- BasicTimeZone(const UnicodeString &id);
-
- /**
- * Copy constructor.
- * @param source the object to be copied.
- * @stable ICU 4.0
- */
- BasicTimeZone(const BasicTimeZone& source);
-
- /**
- * Gets the set of TimeZoneRule instances applicable to the specified time and after.
- * @param start The start date used for extracting time zone rules
- * @param initial Receives the InitialTimeZone, always not NULL
- * @param transitionRules Receives the transition rules, could be NULL
- * @param status Receives error status code
- */
- void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, UVector*& transitionRules,
- UErrorCode& status) /*const*/;
-};
-
-U_NAMESPACE_END
-
-#endif /* #if !UCONFIG_NO_FORMATTING */
-
-#endif // BASICTZ_H
-
-//eof
View
557 icu-1060/unicode/brkiter.h
@@ -1,557 +0,0 @@
-/*
-********************************************************************************
-* Copyright (C) 1997-2007, International Business Machines
-* Corporation and others. All Rights Reserved.
-********************************************************************************
-*
-* File brkiter.h
-*
-* Modification History:
-*
-* Date Name Description
-* 02/18/97 aliu Added typedef for TextCount. Made DONE const.
-* 05/07/97 aliu Fixed DLL declaration.
-* 07/09/97 jfitz Renamed BreakIterator and interface synced with JDK
-* 08/11/98 helena Sync-up JDK1.2.
-* 01/13/2000 helena Added UErrorCode parameter to createXXXInstance methods.
-********************************************************************************
-*/
-
-#ifndef BRKITER_H
-#define BRKITER_H
-
-#include "unicode/utypes.h"
-
-/**
- * \file
- * \brief C++ API: Break Iterator.
- */
-
-#if UCONFIG_NO_BREAK_ITERATION
-
-U_NAMESPACE_BEGIN
-
-/*
- * Allow the declaration of APIs with pointers to BreakIterator
- * even when break iteration is removed from the build.
- */
-class BreakIterator;
-
-U_NAMESPACE_END
-
-#else
-
-#include "unicode/uobject.h"
-#include "unicode/unistr.h"
-#include "unicode/chariter.h"
-#include "unicode/locid.h"
-#include "unicode/ubrk.h"
-#include "unicode/strenum.h"
-#include "unicode/utext.h"
-#include "unicode/umisc.h"
-
-U_NAMESPACE_BEGIN
-
-/**
- * The BreakIterator class implements methods for finding the location
- * of boundaries in text. BreakIterator is an abstract base class.
- * Instances of BreakIterator maintain a current position and scan over
- * text returning the index of characters where boundaries occur.
- * <p>
- * Line boundary analysis determines where a text string can be broken
- * when line-wrapping. The mechanism correctly handles punctuation and
- * hyphenated words.
- * <p>
- * Sentence boundary analysis allows selection with correct
- * interpretation of periods within numbers and abbreviations, and
- * trailing punctuation marks such as quotation marks and parentheses.
- * <p>
- * Word boundary analysis is used by search and replace functions, as
- * well as within text editing applications that allow the user to
- * select words with a double click. Word selection provides correct
- * interpretation of punctuation marks within and following
- * words. Characters that are not part of a word, such as symbols or
- * punctuation marks, have word-breaks on both sides.
- * <p>
- * Character boundary analysis allows users to interact with
- * characters as they expect to, for example, when moving the cursor
- * through a text string. Character boundary analysis provides correct
- * navigation of through character strings, regardless of how the
- * character is stored. For example, an accented character might be
- * stored as a base character and a diacritical mark. What users
- * consider to be a character can differ between languages.
- * <p>
- * The text boundary positions are found according to the rules
- * described in Unicode Standard Annex #29, Text Boundaries, and
- * Unicode Standard Annex #14, Line Breaking Properties. These
- * are available at http://www.unicode.org/reports/tr14/ and
- * http://www.unicode.org/reports/tr29/.
- * <p>
- * In addition to the C++ API defined in this header file, a
- * plain C API with equivalent functionality is defined in the
- * file ubrk.h
- * <p>
- * Code snippits illustrating the use of the Break Iterator APIs
- * are available in the ICU User Guide,
- * http://icu-project.org/userguide/boundaryAnalysis.html
- * and in the sample program icu/source/samples/break/break.cpp"
- *
- */
-class U_COMMON_API BreakIterator : public UObject {
-public:
- /**
- * destructor
- * @stable ICU 2.0
- */
- virtual ~BreakIterator();
-
- /**
- * Return true if another object is semantically equal to this
- * one. The other object should be an instance of the same subclass of
- * BreakIterator. Objects of different subclasses are considered
- * unequal.
- * <P>
- * Return true if this BreakIterator is at the same position in the
- * same text, and is the same class and type (word, line, etc.) of
- * BreakIterator, as the argument. Text is considered the same if
- * it contains the same characters, it need not be the same
- * object, and styles are not considered.
- * @stable ICU 2.0
- */
- virtual UBool operator==(const BreakIterator&) const = 0;
-
- /**
- * Returns the complement of the result of operator==
- * @param rhs The BreakIterator to be compared for inequality
- * @return the complement of the result of operator==
- * @stable ICU 2.0
- */
- UBool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }
-
- /**
- * Return a polymorphic copy of this object. This is an abstract
- * method which subclasses implement.
- * @stable ICU 2.0
- */
- virtual BreakIterator* clone(void) const = 0;
-
- /**
- * Return a polymorphic class ID for this object. Different subclasses
- * will return distinct unequal values.
- * @stable ICU 2.0
- */
- virtual UClassID getDynamicClassID(void) const = 0;
-
- /**
- * Return a CharacterIterator over the text being analyzed.
- * @stable ICU 2.0
- */
- virtual CharacterIterator& getText(void) const = 0;
-
-
- /**
- * Get a UText for the text being analyzed.
- * The returned UText is a shallow clone of the UText used internally
- * by the break iterator implementation. It can safely be used to
- * access the text without impacting any break iterator operations,
- * but the underlying text itself must not be altered.
- *
- * @param fillIn A UText to be filled in. If NULL, a new UText will be
- * allocated to hold the result.
- * @param status receives any error codes.
- * @return The current UText for this break iterator. If an input
- * UText was provided, it will always be returned.
- * @stable ICU 3.4
- */
- virtual UText *getUText(UText *fillIn, UErrorCode &status) const = 0;
-
- /**
- * Change the text over which this operates. The text boundary is
- * reset to the start.
- * @param text The UnicodeString used to change the text.
- * @stable ICU 2.0
- */
- virtual void setText(const UnicodeString &text) = 0;
-
- /**
- * Reset the break iterator to operate over the text represented by
- * the UText. The iterator position is reset to the start.
- *
- * This function makes a shallow clone of the supplied UText. This means
- * that the caller is free to immediately close or otherwise reuse the
- * Utext that was passed as a parameter, but that the underlying text itself
- * must not be altered while being referenced by the break iterator.
- *
- * @param text The UText used to change the text.
- * @param status receives any error codes.
- * @stable ICU 3.4
- */
- virtual void setText(UText *text, UErrorCode &status) = 0;
-
- /**
- * Change the text over which this operates. The text boundary is
- * reset to the start.
- * Note that setText(UText *) provides similar functionality to this function,
- * and is more efficient.
- * @param it The CharacterIterator used to change the text.
- * @stable ICU 2.0
- */
- virtual void adoptText(CharacterIterator* it) = 0;
-
- enum {
- /**
- * DONE is returned by previous() and next() after all valid
- * boundaries have been returned.
- * @stable ICU 2.0
- */
- DONE = (int32_t)-1
- };
-
- /**
- * Return the index of the first character in the text being scanned.
- * @stable ICU 2.0
- */
- virtual int32_t first(void) = 0;
-
- /**
- * Return the index immediately BEYOND the last character in the text being scanned.
- * @stable ICU 2.0
- */
- virtual int32_t last(void) = 0;
-
- /**
- * Return the boundary preceding the current boundary.
- * @return The character index of the previous text boundary or DONE if all
- * boundaries have been returned.
- * @stable ICU 2.0
- */
- virtual int32_t previous(void) = 0;
-
- /**
- * Return the boundary following the current boundary.
- * @return The character index of the next text boundary or DONE if all
- * boundaries have been returned.
- * @stable ICU 2.0
- */
- virtual int32_t next(void) = 0;
-
- /**
- * Return character index of the current interator position within the text.
- * @return The boundary most recently returned.
- * @stable ICU 2.0
- */
- virtual int32_t current(void) const = 0;
-
- /**
- * Return the first boundary following the specified offset.
- * The value returned is always greater than the offset or
- * the value BreakIterator.DONE
- * @param offset the offset to begin scanning.
- * @return The first boundary after the specified offset.
- * @stable ICU 2.0
- */
- virtual int32_t following(int32_t offset) = 0;
-
- /**
- * Return the first boundary preceding the specified offset.
- * The value returned is always smaller than the offset or
- * the value BreakIterator.DONE
- * @param offset the offset to begin scanning.
- * @return The first boundary before the specified offset.
- * @stable ICU 2.0
- */
- virtual int32_t preceding(int32_t offset) = 0;
-
- /**
- * Return true if the specfied position is a boundary position.
- * As a side effect, the current position of the iterator is set
- * to the first boundary position at or following the specified offset.
- * @param offset the offset to check.
- * @return True if "offset" is a boundary position.
- * @stable ICU 2.0
- */
- virtual UBool isBoundary(int32_t offset) = 0;
-
- /**
- * Return the nth boundary from the current boundary
- * @param n which boundary to return. A value of 0
- * does nothing. Negative values move to previous boundaries
- * and positive values move to later boundaries.
- * @return The index of the nth boundary from the current position, or
- * DONE if there are fewer than |n| boundaries in the specfied direction.
- * @stable ICU 2.0
- */
- virtual int32_t next(int32_t n) = 0;
-
- /**
- * Create BreakIterator for word-breaks using the given locale.
- * Returns an instance of a BreakIterator implementing word breaks.
- * WordBreak is useful for word selection (ex. double click)
- * @param where the locale.
- * @param status the error code
- * @return A BreakIterator for word-breaks. The UErrorCode& status
- * parameter is used to return status information to the user.
- * To check whether the construction succeeded or not, you should check
- * the value of U_SUCCESS(err). If you wish more detailed information, you
- * can check for informational error results which still indicate success.
- * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
- * example, 'de_CH' was requested, but nothing was found there, so 'de' was
- * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
- * used; neither the requested locale nor any of its fall back locales
- * could be found.
- * The caller owns the returned object and is responsible for deleting it.
- * @stable ICU 2.0
- */
- static BreakIterator* U_EXPORT2
- createWordInstance(const Locale& where, UErrorCode& status);
-
- /**
- * Create BreakIterator for line-breaks using specified locale.
- * Returns an instance of a BreakIterator implementing line breaks. Line
- * breaks are logically possible line breaks, actual line breaks are
- * usually determined based on display width.
- * LineBreak is useful for word wrapping text.
- * @param where the locale.
- * @param status The error code.
- * @return A BreakIterator for line-breaks. The UErrorCode& status
- * parameter is used to return status information to the user.
- * To check whether the construction succeeded or not, you should check
- * the value of U_SUCCESS(err). If you wish more detailed information, you
- * can check for informational error results which still indicate success.
- * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
- * example, 'de_CH' was requested, but nothing was found there, so 'de' was
- * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
- * used; neither the requested locale nor any of its fall back locales
- * could be found.
- * The caller owns the returned object and is responsible for deleting it.
- * @stable ICU 2.0
- */
- static BreakIterator* U_EXPORT2
- createLineInstance(const Locale& where, UErrorCode& status);
-
- /**
- * Create BreakIterator for character-breaks using specified locale
- * Returns an instance of a BreakIterator implementing character breaks.
- * Character breaks are boundaries of combining character sequences.
- * @param where the locale.
- * @param status The error code.
- * @return A BreakIterator for character-breaks. The UErrorCode& status
- * parameter is used to return status information to the user.
- * To check whether the construction succeeded or not, you should check
- * the value of U_SUCCESS(err). If you wish more detailed information, you
- * can check for informational error results which still indicate success.
- * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
- * example, 'de_CH' was requested, but nothing was found there, so 'de' was
- * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
- * used; neither the requested locale nor any of its fall back locales
- * could be found.
- * The caller owns the returned object and is responsible for deleting it.
- * @stable ICU 2.0
- */
- static BreakIterator* U_EXPORT2
- createCharacterInstance(const Locale& where, UErrorCode& status);
-
- /**
- * Create BreakIterator for sentence-breaks using specified locale
- * Returns an instance of a BreakIterator implementing sentence breaks.
- * @param where the locale.
- * @param status The error code.
- * @return A BreakIterator for sentence-breaks. The UErrorCode& status
- * parameter is used to return status information to the user.
- * To check whether the construction succeeded or not, you should check
- * the value of U_SUCCESS(err). If you wish more detailed information, you
- * can check for informational error results which still indicate success.
- * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
- * example, 'de_CH' was requested, but nothing was found there, so 'de' was
- * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
- * used; neither the requested locale nor any of its fall back locales
- * could be found.
- * The caller owns the returned object and is responsible for deleting it.
- * @stable ICU 2.0
- */
- static BreakIterator* U_EXPORT2
- createSentenceInstance(const Locale& where, UErrorCode& status);
-
- /**
- * Create BreakIterator for title-casing breaks using the specified locale
- * Returns an instance of a BreakIterator implementing title breaks.
- * The iterator returned locates title boundaries as described for
- * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
- * please use Word Boundary iterator.{@link #createWordInstance }
- *
- * @param where the locale.
- * @param status The error code.
- * @return A BreakIterator for title-breaks. The UErrorCode& status
- * parameter is used to return status information to the user.
- * To check whether the construction succeeded or not, you should check
- * the value of U_SUCCESS(err). If you wish more detailed information, you
- * can check for informational error results which still indicate success.
- * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
- * example, 'de_CH' was requested, but nothing was found there, so 'de' was
- * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
- * used; neither the requested locale nor any of its fall back locales
- * could be found.
- * The caller owns the returned object and is responsible for deleting it.
- * @stable ICU 2.1
- */
- static BreakIterator* U_EXPORT2
- createTitleInstance(const Locale& where, UErrorCode& status);
-
- /**
- * Get the set of Locales for which TextBoundaries are installed.
- * <p><b>Note:</b> this will not return locales added through the register
- * call. To see the registered locales too, use the getAvailableLocales
- * function that returns a StringEnumeration object </p>
- * @param count the output parameter of number of elements in the locale list
- * @return available locales
- * @stable ICU 2.0
- */
- static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
-
- /**
- * Get name of the object for the desired Locale, in the desired langauge.
- * @param objectLocale must be from getAvailableLocales.
- * @param displayLocale specifies the desired locale for output.
- * @param name the fill-in parameter of the return value
- * Uses best match.
- * @return user-displayable name
- * @stable ICU 2.0
- */
- static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
- const Locale& displayLocale,
- UnicodeString& name);
-
- /**
- * Get name of the object for the desired Locale, in the langauge of the
- * default locale.
- * @param objectLocale must be from getMatchingLocales
- * @param name the fill-in parameter of the return value
- * @return user-displayable name
- * @stable ICU 2.0
- */
- static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
- UnicodeString& name);
-
- /**
- * Thread safe client-buffer-based cloning operation
- * Do NOT call delete on a safeclone, since 'new' is not used to create it.
- * @param stackBuffer user allocated space for the new clone. If NULL new memory will be allocated.
- * If buffer is not large enough, new memory will be allocated.
- * @param BufferSize reference to size of allocated space.
- * If BufferSize == 0, a sufficient size for use in cloning will
- * be returned ('pre-flighting')
- * If BufferSize is not enough for a stack-based safe clone,
- * new memory will be allocated.
- * @param status to indicate whether the operation went on smoothly or there were errors
- * An informational status value, U_SAFECLONE_ALLOCATED_ERROR, is used if any allocations were
- * necessary.
- * @return pointer to the new clone
- *
- * @stable ICU 2.0
- */
- virtual BreakIterator * createBufferClone(void *stackBuffer,
- int32_t &BufferSize,
- UErrorCode &status) = 0;
-
- /**
- * Determine whether the BreakIterator was created in user memory by
- * createBufferClone(), and thus should not be deleted. Such objects
- * must be closed by an explicit call to the destructor (not delete).
- * @stable ICU 2.0
- */
- inline UBool isBufferClone(void);
-
-#if !UCONFIG_NO_SERVICE
- /**
- * Register a new break iterator of the indicated kind, to use in the given locale.
- * The break iterator will be adopted. Clones of the iterator will be returned
- * if a request for a break iterator of the given kind matches or falls back to
- * this locale.
- * @param toAdopt the BreakIterator instance to be adopted
- * @param locale the Locale for which this instance is to be registered
- * @param kind the type of iterator for which this instance is to be registered
- * @param status the in/out status code, no special meanings are assigned
- * @return a registry key that can be used to unregister this instance
- * @stable ICU 2.4
- */
- static URegistryKey U_EXPORT2 registerInstance(BreakIterator* toAdopt,
- const Locale& locale,
- UBreakIteratorType kind,
- UErrorCode& status);
-
- /**
- * Unregister a previously-registered BreakIterator using the key returned from the
- * register call. Key becomes invalid after a successful call and should not be used again.
- * The BreakIterator corresponding to the key will be deleted.
- * @param key the registry key returned by a previous call to registerInstance
- * @param status the in/out status code, no special meanings are assigned
- * @return TRUE if the iterator for the key was successfully unregistered
- * @stable ICU 2.4
- */
- static UBool U_EXPORT2 unregister(URegistryKey key, UErrorCode& status);
-
- /**
- * Return a StringEnumeration over the locales available at the time of the call,
- * including registered locales.
- * @return a StringEnumeration over the locales available at the time of the call
- * @stable ICU 2.4
- */
- static StringEnumeration* U_EXPORT2 getAvailableLocales(void);
-#endif
-
- /**
- * Returns the locale for this break iterator. Two flavors are available: valid and
- * actual locale.
- * @stable ICU 2.8
- */
- Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
-
- /** Get the locale for this break iterator object. You can choose between valid and actual locale.
- * @param type type of the locale we're looking for (valid or actual)
- * @param status error code for the operation
- * @return the locale
- * @internal
- */
- const char *getLocaleID(ULocDataLocaleType type, UErrorCode& status) const;
-
- private:
- static BreakIterator* buildInstance(const Locale& loc, const char *type, int32_t kind, UErrorCode& status);
- static BreakIterator* createInstance(const Locale& loc, int32_t kind, UErrorCode& status);
- static BreakIterator* makeInstance(const Locale& loc, int32_t kind, UErrorCode& status);
-
- friend class ICUBreakIteratorFactory;
- friend class ICUBreakIteratorService;
-
-protected:
- /** @internal */
- BreakIterator();
- /** @internal */
- UBool fBufferClone;
- /** @internal */
- BreakIterator (const BreakIterator &other) : UObject(other), fBufferClone(FALSE) {}
-
-private:
-
- /** @internal */
- char actualLocale[ULOC_FULLNAME_CAPACITY];
- char validLocale[ULOC_FULLNAME_CAPACITY];
-
- /**
- * The assignment operator has no real implementation.
- * It's provided to make the compiler happy. Do not call.
- */
- BreakIterator& operator=(const BreakIterator&);
-};
-
-inline UBool BreakIterator::isBufferClone()
-{
- return fBufferClone;
-}
-
-U_NAMESPACE_END
-
-#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
-
-#endif // _BRKITER
-//eof
-
View
2,170 icu-1060/unicode/calendar.h
@@ -1,2170 +0,0 @@
-/*
-********************************************************************************
-* Copyright (C) 1997-2008, International Business Machines
-* Corporation and others. All Rights Reserved.
-********************************************************************************
-*
-* File CALENDAR.H
-*
-* Modification History:
-*
-* Date Name Description
-* 04/22/97 aliu Expanded and corrected comments and other header
-* contents.
-* 05/01/97 aliu Made equals(), before(), after() arguments const.
-* 05/20/97 aliu Replaced fAreFieldsSet with fAreFieldsInSync and
-* fAreAllFieldsSet.
-* 07/27/98 stephen Sync up with JDK 1.2
-* 11/15/99 weiv added YEAR_WOY and DOW_LOCAL
-* to EDateFields
-* 8/19/2002 srl Removed Javaisms
-* 11/07/2003 srl Update, clean up documentation.
-********************************************************************************
-*/
-
-#ifndef CALENDAR_H
-#define CALENDAR_H
-
-#include "unicode/utypes.h"
-
-/**
- * \file
- * \brief C++ API: Calendar object
- */
-#if !UCONFIG_NO_FORMATTING
-
-#include "unicode/uobject.h"
-#include "unicode/locid.h"
-#include "unicode/timezone.h"
-#include "unicode/ucal.h"
-#include "unicode/umisc.h"
-
-U_NAMESPACE_BEGIN
-
-class ICUServiceFactory;
-
-/**
- * @internal
- */
-typedef int32_t UFieldResolutionTable[12][8];
-
-/**
- * <code>Calendar</code> is an abstract base class for converting between
- * a <code>UDate</code> object and a set of integer fields such as
- * <code>YEAR</code>, <code>MONTH</code>, <code>DAY</code>, <code>HOUR</code>,
- * and so on. (A <code>UDate</code> object represents a specific instant in
- * time with millisecond precision. See UDate
- * for information about the <code>UDate</code> class.)
- *
- * <p>
- * Subclasses of <code>Calendar</code> interpret a <code>UDate</code>
- * according to the rules of a specific calendar system.
- * The most commonly used subclass of <code>Calendar</code> is
- * <code>GregorianCalendar</code>. Other subclasses could represent
- * the various types of lunar calendars in use in many parts of the world.
- *
- * <p>
- * <b>NOTE</b>: (ICU 2.6) The subclass interface should be considered unstable
- * - it WILL change.
- *
- * <p>
- * Like other locale-sensitive classes, <code>Calendar</code> provides a
- * static method, <code>createInstance</code>, for getting a generally useful
- * object of this type. <code>Calendar</code>'s <code>createInstance</code> method
- * returns the appropriate <code>Calendar</code> subclass whose
- * time fields have been initialized with the current date and time:
- * \htmlonly<blockquote>\endhtmlonly
- * <pre>
- * Calendar *rightNow = Calendar::createInstance(errCode);
- * </pre>
- * \htmlonly</blockquote>\endhtmlonly
- *
- * <p>
- * A <code>Calendar</code> object can produce all the time field values
- * needed to implement the date-time formatting for a particular language
- * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
- *
- * <p>
- * When computing a <code>UDate</code> from time fields, two special circumstances
- * may arise: there may be insufficient information to compute the
- * <code>UDate</code> (such as only year and month but no day in the month),
- * or there may be inconsistent information (such as "Tuesday, July 15, 1996"
- * -- July 15, 1996 is actually a Monday).
- *
- * <p>
- * <strong>Insufficient information.</strong> The calendar will use default
- * information to specify the missing fields. This may vary by calendar; for
- * the Gregorian calendar, the default for a field is the same as that of the
- * start of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc.
- *
- * <p>
- * <strong>Inconsistent information.</strong> If fields conflict, the calendar
- * will give preference to fields set more recently. For example, when
- * determining the day, the calendar will look for one of the following
- * combinations of fields. The most recent combination, as determined by the
- * most recently set single field, will be used.
- *
- * \htmlonly<blockquote>\endhtmlonly
- * <pre>
- * MONTH + DAY_OF_MONTH
- * MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
- * MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
- * DAY_OF_YEAR
- * DAY_OF_WEEK + WEEK_OF_YEAR
- * </pre>
- * \htmlonly</blockquote>\endhtmlonly
- *
- * For the time of day:
- *
- * \htmlonly<blockquote>\endhtmlonly
- * <pre>
- * HOUR_OF_DAY
- * AM_PM + HOUR
- * </pre>
- * \htmlonly</blockquote>\endhtmlonly
- *
- * <p>
- * <strong>Note:</strong> for some non-Gregorian calendars, different
- * fields may be necessary for complete disambiguation. For example, a full
- * specification of the historial Arabic astronomical calendar requires year,
- * month, day-of-month <em>and</em> day-of-week in some cases.
- *
- * <p>
- * <strong>Note:</strong> There are certain possible ambiguities in
- * interpretation of certain singular times, which are resolved in the
- * following ways:
- * <ol>
- * <li> 24:00:00 "belongs" to the following day. That is,
- * 23:59 on Dec 31, 1969 &lt; 24:00 on Jan 1, 1970 &lt; 24:01:00 on Jan 1, 1970
- *
- * <li> Although historically not precise, midnight also belongs to "am",
- * and noon belongs to "pm", so on the same day,
- * 12:00 am (midnight) &lt; 12:01 am, and 12:00 pm (noon) &lt; 12:01 pm
- * </ol>
- *
- * <p>
- * The date or time format strings are not part of the definition of a
- * calendar, as those must be modifiable or overridable by the user at
- * runtime. Use {@link DateFormat}
- * to format dates.
- *
- * <p>
- * <code>Calendar</code> provides an API for field "rolling", where fields
- * can be incremented or decremented, but wrap around. For example, rolling the
- * month up in the date <code>December 12, <b>1996</b></code> results in
- * <code>January 12, <b>1996</b></code>.
- *
- * <p>
- * <code>Calendar</code> also provides a date arithmetic function for
- * adding the specified (signed) amount of time to a particular time field.
- * For example, subtracting 5 days from the date <code>September 12, 1996</code>
- * results in <code>September 7, 1996</code>.
- *
- * @stable ICU 2.0
- */
-class U_I18N_API Calendar : public UObject {
-public:
-
- /**
- * Field IDs for date and time. Used to specify date/time fields. ERA is calendar
- * specific. Example ranges given are for illustration only; see specific Calendar
- * subclasses for actual ranges.
- * @deprecated ICU 2.6. Use C enum UCalendarDateFields defined in ucal.h
- */
- enum EDateFields {
-#ifndef U_HIDE_DEPRECATED_API
- ERA, // Example: 0..1
- YEAR, // Example: 1..big number
- MONTH, // Example: 0..11
- WEEK_OF_YEAR, // Example: 1..53
- WEEK_OF_MONTH, // Example: 1..4
- DATE, // Example: 1..31
- DAY_OF_YEAR, // Example: 1..365
- DAY_OF_WEEK, // Example: 1..7
- DAY_OF_WEEK_IN_MONTH, // Example: 1..4, may be specified as -1
- AM_PM, // Example: 0..1
- HOUR, // Example: 0..11
- HOUR_OF_DAY, // Example: 0..23
- MINUTE, // Example: 0..59
- SECOND, // Example: 0..59
- MILLISECOND, // Example: 0..999
- ZONE_OFFSET, // Example: -12*U_MILLIS_PER_HOUR..12*U_MILLIS_PER_HOUR
- DST_OFFSET, // Example: 0 or U_MILLIS_PER_HOUR
- YEAR_WOY, // 'Y' Example: 1..big number - Year of Week of Year
- DOW_LOCAL, // 'e' Example: 1..7 - Day of Week / Localized
-
- EXTENDED_YEAR,
- JULIAN_DAY,
- MILLISECONDS_IN_DAY,
- IS_LEAP_MONTH,
-
- FIELD_COUNT = UCAL_FIELD_COUNT // See ucal.h for other fields.
-#endif /* U_HIDE_DEPRECATED_API */
- };
-
- /**
- * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
- * who create locale resources for the field of first-day-of-week should be aware of
- * this. For instance, in US locale, first-day-of-week is set to 1, i.e., SUNDAY.
- * @deprecated ICU 2.6. Use C enum UCalendarDaysOfWeek defined in ucal.h
- */
- enum EDaysOfWeek {
-#ifndef U_HIDE_DEPRECATED_API
- SUNDAY = 1,
- MONDAY,
- TUESDAY,
- WEDNESDAY,
- THURSDAY,
- FRIDAY,
- SATURDAY
-#endif /* U_HIDE_DEPRECATED_API */
- };
-
- /**
- * Useful constants for month. Note: Calendar month is 0-based.
- * @deprecated ICU 2.6. Use C enum UCalendarMonths defined in ucal.h
- */
- enum EMonths {
-#ifndef U_HIDE_DEPRECATED_API
- JANUARY,
- FEBRUARY,
- MARCH,
- APRIL,
- MAY,
- JUNE,
- JULY,
- AUGUST,
- SEPTEMBER,
- OCTOBER,
- NOVEMBER,
- DECEMBER,
- UNDECIMBER
-#endif /* U_HIDE_DEPRECATED_API */
- };
-
- /**
- * Useful constants for hour in 12-hour clock. Used in GregorianCalendar.
- * @deprecated ICU 2.6. Use C enum UCalendarAMPMs defined in ucal.h
- */
- enum EAmpm {
-#ifndef U_HIDE_DEPRECATED_API
- AM,
- PM
-#endif /* U_HIDE_DEPRECATED_API */
- };
-
- /**
- * destructor
- * @stable ICU 2.0
- */
- virtual ~Calendar();
-
- /**
- * Create and return a polymorphic copy of this calendar.
- *
- * @return a polymorphic copy of this calendar.
- * @stable ICU 2.0
- */
- virtual Calendar* clone(void) const = 0;
-
- /**
- * Creates a Calendar using the default timezone and locale. Clients are responsible
- * for deleting the object returned.
- *
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise. U_MISSING_RESOURCE_ERROR will be returned if the resource data
- * requests a calendar type which has not been installed.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(UErrorCode& success);
-
- /**
- * Creates a Calendar using the given timezone and the default locale.
- * The Calendar takes ownership of zoneToAdopt; the
- * client must not delete it.
- *
- * @param zoneToAdopt The given timezone to be adopted.
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
-
- /**
- * Creates a Calendar using the given timezone and the default locale. The TimeZone
- * is _not_ adopted; the client is still responsible for deleting it.
- *
- * @param zone The timezone.
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, UErrorCode& success);
-
- /**
- * Creates a Calendar using the default timezone and the given locale.
- *
- * @param aLocale The given locale.
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(const Locale& aLocale, UErrorCode& success);
-
- /**
- * Creates a Calendar using the given timezone and given locale.
- * The Calendar takes ownership of zoneToAdopt; the
- * client must not delete it.
- *
- * @param zoneToAdopt The given timezone to be adopted.
- * @param aLocale The given locale.
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
-
- /**
- * Gets a Calendar using the given timezone and given locale. The TimeZone
- * is _not_ adopted; the client is still responsible for deleting it.
- *
- * @param zoneToAdopt The given timezone to be adopted.
- * @param aLocale The given locale.
- * @param success Indicates the success/failure of Calendar creation. Filled in
- * with U_ZERO_ERROR if created successfully, set to a failure result
- * otherwise.
- * @return A Calendar if created successfully. NULL otherwise.
- * @stable ICU 2.0
- */
- static Calendar* U_EXPORT2 createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
-
- /**
- * Returns a list of the locales for which Calendars are installed.
- *
- * @param count Number of locales returned.
- * @return An array of Locale objects representing the set of locales for which
- * Calendars are installed. The system retains ownership of this list;
- * the caller must NOT delete it. Does not include user-registered Calendars.
- * @stable ICU 2.0
- */
- static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
-
- /**
- * Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70
- * (derived from the system time).
- *
- * @return The current UTC time in milliseconds.
- * @stable ICU 2.0
- */
- static UDate U_EXPORT2 getNow(void);
-
- /**
- * Gets this Calendar's time as milliseconds. May involve recalculation of time due
- * to previous calls to set time field values. The time specified is non-local UTC
- * (GMT) time. Although this method is const, this object may actually be changed
- * (semantically const).
- *
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @return The current time in UTC (GMT) time, or zero if the operation
- * failed.
- * @stable ICU 2.0
- */
- inline UDate getTime(UErrorCode& status) const { return getTimeInMillis(status); }
-
- /**
- * Sets this Calendar's current time with the given UDate. The time specified should
- * be in non-local UTC (GMT) time.
- *
- * @param date The given UDate in UTC (GMT) time.
- * @param status Output param set to success/failure code on exit. If any value
- * set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @stable ICU 2.0
- */
- inline void setTime(UDate date, UErrorCode& status) { setTimeInMillis(date, status); }
-
- /**
- * Compares the equality of two Calendar objects. Objects of different subclasses
- * are considered unequal. This comparison is very exacting; two Calendar objects
- * must be in exactly the same state to be considered equal. To compare based on the
- * represented time, use equals() instead.
- *
- * @param that The Calendar object to be compared with.
- * @return True if the given Calendar is the same as this Calendar; false
- * otherwise.
- * @stable ICU 2.0
- */
- virtual UBool operator==(const Calendar& that) const;
-
- /**
- * Compares the inequality of two Calendar objects.
- *
- * @param that The Calendar object to be compared with.
- * @return True if the given Calendar is not the same as this Calendar; false
- * otherwise.
- * @stable ICU 2.0
- */
- UBool operator!=(const Calendar& that) const {return !operator==(that);}
-
- /**
- * Returns TRUE if the given Calendar object is equivalent to this
- * one. An equivalent Calendar will behave exactly as this one
- * does, but it may be set to a different time. By contrast, for
- * the operator==() method to return TRUE, the other Calendar must
- * be set to the same time.
- *
- * @param other the Calendar to be compared with this Calendar
- * @stable ICU 2.4
- */
- virtual UBool isEquivalentTo(const Calendar& other) const;
-
- /**
- * Compares the Calendar time, whereas Calendar::operator== compares the equality of
- * Calendar objects.
- *
- * @param when The Calendar to be compared with this Calendar. Although this is a
- * const parameter, the object may be modified physically
- * (semantically const).
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @return True if the current time of this Calendar is equal to the time of
- * Calendar when; false otherwise.
- * @stable ICU 2.0
- */
- UBool equals(const Calendar& when, UErrorCode& status) const;
-
- /**
- * Returns true if this Calendar's current time is before "when"'s current time.
- *
- * @param when The Calendar to be compared with this Calendar. Although this is a
- * const parameter, the object may be modified physically
- * (semantically const).
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @return True if the current time of this Calendar is before the time of
- * Calendar when; false otherwise.
- * @stable ICU 2.0
- */
- UBool before(const Calendar& when, UErrorCode& status) const;
-
- /**
- * Returns true if this Calendar's current time is after "when"'s current time.
- *
- * @param when The Calendar to be compared with this Calendar. Although this is a
- * const parameter, the object may be modified physically
- * (semantically const).
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @return True if the current time of this Calendar is after the time of
- * Calendar when; false otherwise.
- * @stable ICU 2.0
- */
- UBool after(const Calendar& when, UErrorCode& status) const;
-
- /**
- * UDate Arithmetic function. Adds the specified (signed) amount of time to the given
- * time field, based on the calendar's rules. For example, to subtract 5 days from
- * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
- * the month or Calendar::MONTH field, other fields like date might conflict and
- * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
- * in 02/29/96.
- *
- * @param field Specifies which date field to modify.
- * @param amount The amount of time to be added to the field, in the natural unit
- * for that field (e.g., days for the day fields, hours for the hour
- * field.)
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @deprecated ICU 2.6. use add(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.
- */
- virtual void add(EDateFields field, int32_t amount, UErrorCode& status);
-
- /**
- * UDate Arithmetic function. Adds the specified (signed) amount of time to the given
- * time field, based on the calendar's rules. For example, to subtract 5 days from
- * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
- * the month or Calendar::MONTH field, other fields like date might conflict and
- * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
- * in 02/29/96.
- *
- * @param field Specifies which date field to modify.
- * @param amount The amount of time to be added to the field, in the natural unit
- * for that field (e.g., days for the day fields, hours for the hour
- * field.)
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @stable ICU 2.6.
- */
- virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode& status);
-
- /**
- * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
- * time field. For example, to roll the current date up by one day, call
- * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
- * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
- * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
- * Calendar::MONTH field, other fields like date might conflict and, need to be
- * changed. For instance, rolling the month up on the date 01/31/96 will result in
- * 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year
- * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
- * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
- * between 0 and 23, which is zero-based.
- * <P>
- * NOTE: Do not use this method -- use roll(EDateFields, int, UErrorCode&) instead.
- *
- * @param field The time field.
- * @param up Indicates if the value of the specified time field is to be rolled
- * up or rolled down. Use true if rolling up, false otherwise.
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, UBool up, UErrorCode& status) instead.
- */
- inline void roll(EDateFields field, UBool up, UErrorCode& status);
-
- /**
- * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
- * time field. For example, to roll the current date up by one day, call
- * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
- * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
- * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
- * Calendar::MONTH field, other fields like date might conflict and, need to be
- * changed. For instance, rolling the month up on the date 01/31/96 will result in
- * 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year
- * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
- * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
- * between 0 and 23, which is zero-based.
- * <P>
- * NOTE: Do not use this method -- use roll(UCalendarDateFields, int, UErrorCode&) instead.
- *
- * @param field The time field.
- * @param up Indicates if the value of the specified time field is to be rolled
- * up or rolled down. Use true if rolling up, false otherwise.
- * @param status Output param set to success/failure code on exit. If any value
- * previously set in the time field is invalid or restricted by
- * leniency, this will be set to an error status.
- * @stable ICU 2.6.
- */
- inline void roll(UCalendarDateFields field, UBool up, UErrorCode& status);
-
- /**
- * Time Field Rolling function. Rolls by the given amount on the given
- * time field. For example, to roll the current date up by one day, call
- * roll(Calendar::DATE, +1, status). When rolling on the month or
- * Calendar::MONTH field, other fields like date might conflict and, need to be
- * changed. For instance, rolling the month up on the date 01/31/96 will result in
- * 02/29/96. Rolling by a positive value always means rolling forward in time;
- * e.g., rolling the year by +1 on "100 BC" will result in "99 BC", for Gregorian
- * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
- * roll the hour value in the range between 0 and 23, which is zero-based.
- * <P>
- * The only difference between roll() and add() is that roll() does not change
- * the value of more significant fields when it reaches the minimum or maximum
- * of its range, whereas add() does.
- *
- * @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);
-
- /**
- * Time Field Rolling function. Rolls by the given amount on the given
- * time field. For example, to roll the current date up by one day, call
- * roll(Calendar::DATE, +1, status). When rolling on the month or
- * Calendar::MONTH field, other fields like date might conflict and, need to be
- * changed. For instance, rolling the month up on the date 01/31/96 will result in
- * 02/29/96. Rolling by a positive value always means rolling forward in time;
- * e.g., rolling the year by +1 on "100 BC" will result in "99 BC", for Gregorian
- * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
- * roll the hour value in the range between 0 and 23, which is zero-based.
- * <P>
- * The only difference between roll() and add() is that roll() does not change
- * the value of more significant fields when it reaches the minimum or maximum
- * of its range, whereas add() does.
- *
- * @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);
-
- /**
- * Return the difference between the given time and the time this
- * calendar object is set to. If this calendar is set
- * <em>before</em> the given time, the returned value will be
- * positive. If this calendar is set <em>after</em> the given
- * time, the returned value will be negative. The
- * <code>field</code> parameter specifies the units of the return
- * value. For example, if <code>fieldDifference(when,
- * Calendar::MONTH)</code> returns 3, then this calendar is set to
- * 3 months before <code>when</code>, and possibly some addition
- * time less than one month.
- *
- * <p>As a side effect of this call, this calendar is advanced
- * toward <code>when</code> by the given amount. That is, calling
- * this method has the side effect of calling <code>add(field,
- * n)</code>, where <code>n</code> is the return value.
- *
- * <p>Usage: To use this method, call it first with the largest
- * field of interest, then with progressively smaller fields. For
- * example:
- *
- * <pre>
- * int y = cal->fieldDifference(when, Calendar::YEAR, err);
- * int m = cal->fieldDifference(when, Calendar::MONTH, err);
- * int d = cal->fieldDifference(when, Calendar::DATE, err);</pre>
- *
- * computes the difference between <code>cal</code> and
- * <code>when</code> in years, months, and days.
- *
- * <p>Note: <code>fieldDifference()</code> is
- * <em>asymmetrical</em>. That is, in the following code:
- *
- * <pre>
- * cal->setTime(date1, err);
- * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
- * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
- * cal->setTime(date2, err);
- * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
- * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);</pre>
- *
- * one might expect that <code>m1 == -m2 && d1 == -d2</code>.
- * However, this is not generally the case, because of
- * irregularities in the underlying calendar system (e.g., the
- * Gregorian calendar has a varying number of days per month).
- *
- * @param when the date to compare this calendar's time to
- * @param field the field in which to compute the result
- * @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.
- * @return the difference, either positive or negative, between
- * this calendar's time and <code>when</code>, in terms of
- * <code>field</code>.
- * @deprecated ICU 2.6. Use fieldDifference(UDate when, UCalendarDateFields field, UErrorCode& status).
- */
- virtual int32_t fieldDifference(UDate when, EDateFields field, UErrorCode& status);
-
- /**
- * Return the difference between the given time and the time this
- * calendar object is set to. If this calendar is set
- * <em>before</em> the given time, the returned value will be
- * positive. If this calendar is set <em>after</em> the given
- * time, the returned value will be negative. The
- * <code>field</code> parameter specifies the units of the return
- * value. For example, if <code>fieldDifference(when,
- * Calendar::MONTH)</code> returns 3, then this calendar is set to
- * 3 months before <code>when</code>, and possibly some addition
- * time less than one month.
- *
- * <p>As a side effect of this call, this calendar is advanced
- * toward <code>when</code> by the given amount. That is, calling
- * this method has the side effect of calling <code>add(field,
- * n)</code>, where <code>n</code> is the return value.
- *
- * <p>Usage: To use this method, call it first with the largest
- * field of interest, then with progressively smaller fields. For
- * example:
- *
- * <pre>
- * int y = cal->fieldDifference(when, Calendar::YEAR, err);
- * int m = cal->fieldDifference(when, Calendar::MONTH, err);
- * int d = cal->fieldDifference(when, Calendar::DATE, err);</pre>
- *
- * computes the difference between <code>cal</code> and
- * <code>when</code> in years, months, and days.
- *
- * <p>Note: <code>fieldDifference()</code> is
- * <em>asymmetrical</em>. That is, in the following code:
- *
- * <pre>
- * cal->setTime(date1, err);
- * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
- * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
- * cal->setTime(date2, err);
- * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
- * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);</pre>
- *
- * one might expect that <code>m1 == -m2 && d1 == -d2</code>.
- * However, this is not generally the case, because of
- * irregularities in the underlying calendar system (e.g., the
- * Gregorian calendar has a varying number of days per month).
- *
- * @param when the date to compare this calendar's time to
- * @param field the field in which to compute the result
- * @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.
- * @return the difference, either positive or negative, between
- * this calendar's time and <code>when</code>, in terms of
- * <code>field</code>.
- * @stable ICU 2.6.
- */
- virtual int32_t fieldDifference(UDate when, UCalendarDateFields field, UErrorCode& status);
-
- /**
- * Sets the calendar's time zone to be the one passed in. The Calendar takes ownership
- * of the TimeZone; the caller is no longer responsible for deleting it. If the
- * given time zone is NULL, this function has no effect.
- *
- * @param value The given time zone.
- * @stable ICU 2.0
- */
- void adoptTimeZone(TimeZone* value);
-
- /**
- * Sets the calendar's time zone to be the same as the one passed in. The TimeZone
- * passed in is _not_ adopted; the client is still responsible for deleting it.
- *
- * @param zone The given time zone.
- * @stable ICU 2.0
- */
- void setTimeZone(const TimeZone& zone);
-
- /**
- * Returns a reference to the time zone owned by this calendar. The returned reference
- * is only valid until clients make another call to adoptTimeZone or setTimeZone,
- * or this Calendar is destroyed.
- *
- * @return The time zone object associated with this calendar.
- * @stable ICU 2.0
- */
- const TimeZone& getTimeZone(void) const;
-
- /**
- * Returns the time zone owned by this calendar. The caller owns the returned object
- * and must delete it when done. After this call, the new time zone associated
- * with this Calendar is the default TimeZone as returned by TimeZone::createDefault().
- *
- * @return The time zone object which was associated with this calendar.
- * @stable ICU 2.0
- */
- TimeZone* orphanTimeZone(void);
-
- /**
- * Queries if the current date for this Calendar is in Daylight Savings Time.
- *
- * @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 = 0;
-
- /**
- * Specifies whether or not date/time interpretation is to be lenient. With lenient
- * interpretation, a date such as "February 942, 1996" will be treated as being
- * equivalent to the 941st day after February 1, 1996. With strict interpretation,
- * such dates will cause an error when computing time from the time field values
- * representing the dates.
- *
- * @param lenient True specifies date/time interpretation to be lenient.
- *
- * @see DateFormat#setLenient
- * @stable ICU 2.0
- */
- void setLenient(UBool lenient);
-
- /**
- * Tells whether date/time interpretation is to be lenient.
- *
- * @return True tells that date/time interpretation is to be lenient.
- * @stable ICU 2.0
- */
- UBool isLenient(void) const;
-
- /**
- * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
- *
- * @param value The given first day of the week.
- * @deprecated ICU 2.6. Use setFirstDayOfWeek(UCalendarDaysOfWeek value) instead.
- */
- void setFirstDayOfWeek(EDaysOfWeek value);
-
- /**
- * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
- *
- * @param value The given first day of the week.
- * @stable ICU 2.6.
- */
- void setFirstDayOfWeek(UCalendarDaysOfWeek value);
-
- /**
- * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
- *
- * @return The first day of the week.
- * @deprecated ICU 2.6 use the overload with error code
- */
- EDaysOfWeek getFirstDayOfWeek(void) const;
-
- /**
- * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
- *
- * @param status error code
- * @return The first day of the week.
- * @stable ICU 2.6
- */
- UCalendarDaysOfWeek getFirstDayOfWeek(UErrorCode &status) const;
-
- /**
- * Sets what the minimal days required in the first week of the year are; For
- * example, if the first week is defined as one that contains the first day of the
- * first month of a year, call the method with value 1. If it must be a full week,
- * use value 7.
- *
- * @param value The given minimal days required in the first week of the year.
- * @stable ICU 2.0
- */
- void setMinimalDaysInFirstWeek(uint8_t value);
-
- /**
- * Gets what the minimal days required in the first week of the year are; e.g., if
- * the first week is defined as one that contains the first day of the first month
- * of a year, getMinimalDaysInFirstWeek returns 1. If the minimal days required must
- * be a full week, getMinimalDaysInFirstWeek returns 7.
- *
- * @return The minimal days required in the first week of the year.
- * @stable ICU 2.0
- */
- uint8_t getMinimalDaysInFirstWeek(void) const;
-
- /**
- * Gets the minimum value for the given time field. e.g., for Gregorian
- * DAY_OF_MONTH, 1.
- *
- * @param field The given time field.
- * @return The minimum value for the given time field.
- * @deprecated ICU 2.6. Use getMinimum(UCalendarDateFields field) instead.
- */
- virtual int32_t getMinimum(EDateFields field) const;
-
- /**
- * Gets the minimum value for the given time field. e.g., for Gregorian
- * DAY_OF_MONTH, 1.
- *
- * @param field The given time field.
- * @return The minimum value for the given time field.
- * @stable ICU 2.6.
- */
- virtual int32_t getMinimum(UCalendarDateFields field) const;
-
- /**
- * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH,
- * 31.
- *
- * @param field The given time field.
- * @return The maximum value for the given time field.
- * @deprecated ICU 2.6. Use getMaximum(UCalendarDateFields field) instead.
- */
- virtual int32_t getMaximum(EDateFields field) const;
-
- /**
- * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH,
- * 31.
- *
- * @param field The given time field.
- * @return The maximum value for the given time field.
- * @stable ICU 2.6.
- */
- virtual int32_t getMaximum(UCalendarDateFields field) const;
-
- /**
- * Gets the highest minimum value for the given field if varies. Otherwise same as
- * getMinimum(). For Gregorian, no difference.
- *
- * @param field The given time field.
- * @return The highest minimum value for the given time field.
- * @deprecated ICU 2.6. Use getGreatestMinimum(UCalendarDateFields field) instead.
- */
- virtual int32_t getGreatestMinimum(EDateFields field) const;
-
- /**
- * Gets the highest minimum value for the given field if varies. Otherwise same as
- * getMinimum(). For Gregorian, no difference.
- *
- * @param field The given time field.
- * @return The highest minimum value for the given time field.
- * @stable ICU 2.6.
- */
- virtual int32_t getGreatestMinimum(UCalendarDateFields field) const;
-
- /**
- * Gets the lowest maximum value for the given field if varies. Otherwise same as
- * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28.
- *
- * @param field The given time field.
- * @return The lowest maximum value for the given time field.
- * @deprecated ICU 2.6. Use getLeastMaximum(UCalendarDateFields field) instead.
- */
- virtual int32_t getLeastMaximum(EDateFields field) const;
-
- /**
- * Gets the lowest maximum value for the given field if varies. Otherwise same as
- * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28.
- *
- * @param field The given time field.
- * @return The lowest maximum value for the given time field.
- * @stable ICU 2.6.
- */
- virtual int32_t getLeastMaximum(UCalendarDateFields 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().
- *
- * The version of this function on Calendar uses an iterative algorithm to determine the
- * actual minimum value for the field. There is almost always a more efficient way to
- * accomplish this (in most cases, you can simply return getMinimum()). GregorianCalendar
- * overrides this function with a more efficient implementation.
- *
- * @param field the field to determine the minimum of
- * @param status Fill-in parameter which receives the status of this operation.
- * @return the minimum of the given field for the current date of this Calendar
- * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field, UErrorCode& status) instead.
- */
- int32_t getActualMinimum(EDateFields field, UErrorCode& status) 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().
- *
- * The version of this function on Calendar uses an iterative algorithm to determine the
- * actual minimum value for the field. There is almost always a more efficient way to
- * accomplish this (in most cases, you can simply return getMinimum()). GregorianCalendar
- * overrides this function with a more efficient implementation.
- *
- * @param field the field to determine the minimum of
- * @param status Fill-in parameter which receives the status of this operation.
- * @return the minimum of the given field for the current date of this Calendar
- * @stable ICU 2.6.
- */
- virtual int32_t getActualMinimum(UCalendarDateFields field, UErrorCode& status) const;
-
- /**
- * 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.
- *
- * The version of this function on Calendar uses an iterative algorithm to determine the
- * actual maximum value for the field. There is almost always a more efficient way to
- * accomplish this (in most cases, you can simply return getMaximum()). GregorianCalendar
- * overrides this function with a more efficient implementation.
- *
- * @param field the field to determine the maximum of
- * @param status Fill-in parameter which receives the status of this operation.
- * @return the maximum of the given field for the current date of this Calendar
- * @deprecated ICU 2.6. Use getActualMaximum(UCalendarDateFields field, UErrorCode& status) instead.
- */
- int32_t getActualMaximum(EDateFields field, UErrorCode& status) const;
-
- /**
- * 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.
- *
- * The version of this function on Calendar uses an iterative algorithm to determine the
- * actual maximum value for the field. There is almost always a more efficient way to
- * accomplish this (in most cases, you can simply return getMaximum()). GregorianCalendar
- * overrides this function with a more efficient implementation.
- *
- * @param field the field to determine the maximum of
- * @param status Fill-in parameter which receives the status of this operation.
- * @return the maximum of the given field for the current date of this Calendar
- * @stable ICU 2.6.
- */
- virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const;
-
- /**
- * Gets the value for a given time field. Recalculate the current time field values
- * if the time value has been changed by a call to setTime(). Return zero for unset
- * fields if any fields have been explicitly set by a call to set(). To force a
- * recomputation of all fields regardless of the previous state, call complete().
- * This method is semantically const, but may alter the object in memory.
- *
- * @param field The given time field.
- * @param status Fill-in parameter which receives the status of the operation.
- * @return The value for the given time field, or zero if the field is unset,
- * and set() has been called for any other field.
- * @deprecated ICU 2.6. Use get(UCalendarDateFields field, UErrorCode& status) instead.
- */
- int32_t get(EDateFields field, UErrorCode& status) const;
-
- /**
- * Gets the value for a given time field. Recalculate the current time field values
- * if the time value has been changed by a call to setTime(). Return zero for unset
- * fields if any fields have been explicitly set by a call to set(). To force a
- * recomputation of all fields regardless of the previous state, call complete().
- * This method is semantically const, but may alter the object in memory.
- *
- * @param field The given time field.
- * @param status Fill-in parameter which receives the status of the operation.
- * @return The value for the given time field, or zero if the field is unset,
- * and set() has been called for any other field.
- * @stable ICU 2.6.
- */
- int32_t get(UCalendarDateFields field, UErrorCode& status) const;
-
- /**
- * Determines if the given time field has a value set. This can affect in the
- * resolving of time in Calendar. Unset fields have a value of zero, by definition.
- *
- * @param field The given time field.
- * @return True if the given time field has a value set; false otherwise.
- * @deprecated ICU 2.6. Use isSet(UCalendarDateFields field) instead.
- */
- UBool isSet(EDateFields field) const;
-
- /**
- * Determines if the given time field has a value set. This can affect in the
- * resolving of time in Calendar. Unset fields have a value of zero, by definition.
- *
- * @param field The given time field.
- * @return True if the given time field has a value set; false otherwise.
- * @stable ICU 2.6.
- */
- UBool isSet(UCalendarDateFields field) const;
-
- /**
- * Sets the given time field with the given value.
- *
- * @param field The given time field.
- * @param value The value to be set for the given time field.
- * @deprecated ICU 2.6. Use set(UCalendarDateFields field, int32_t value) instead.
- */
- void set(EDateFields field, int32_t value);
-
- /**
- * Sets the given time field with the given value.
- *
- * @param field The given time field.
- * @param value The value to be set for the given time field.
- * @stable ICU 2.6.
- */
- void set(UCalendarDateFields field, int32_t value);
-
- /**
- * Sets the values for the fields YEAR, MONTH, and DATE. Other field values are
- * retained; call clear() first if this is not desired.
- *
- * @param year The value used to set the YEAR time field.
- * @param month The value used to set the MONTH time field. Month value is 0-based.
- * e.g., 0 for January.
- * @param date The value used to set the DATE time field.
- * @stable ICU 2.0
- */
- void set(int32_t year, int32_t month, int32_t date);
-
- /**
- * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, and MINUTE. Other
- * field values are retained; call clear() first if this is not desired.
- *
- * @param year The value used to set the YEAR time field.
- * @param month The value used to set the MONTH time field. Month value is
- * 0-based. E.g., 0 for January.
- * @param date The value used to set the DATE time field.
- * @param hour The value used to set the HOUR_OF_DAY time field.
- * @param minute The value used to set the MINUTE time field.
- * @stable ICU 2.0
- */
- void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
-
- /**
- * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, MINUTE, and SECOND.
- * Other field values are retained; call clear() first if this is not desired.
- *
- * @param year The value used to set the YEAR time field.
- * @param month The value used to set the MONTH time field. Month value is
- * 0-based. E.g., 0 for January.
- * @param date The value used to set the DATE time field.
- * @param hour The value used to set the HOUR_OF_DAY time field.
- * @param minute The value used to set the MINUTE time field.
- * @param second The value used to set the SECOND time field.
- * @stable ICU 2.0
- */
- void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
-
- /**
- * Clears the values of all the time fields, making them both unset and assigning
- * them a value of zero. The field values will be determined during the next
- * resolving of time into time fields.
- * @stable ICU 2.0
- */
- void clear(void);
-
- /**
- * Clears the value in the given time field, both making it unset and assigning it a
- * value of zero. This field value will be determined during the next resolving of
- * time into time fields.
- *
- * @param field The time field to be cleared.
- * @deprecated ICU 2.6. Use clear(UCalendarDateFields field) instead.
- */
- void clear(EDateFields field);
-
- /**
- * Clears the value in the given time field, both making it unset and assigning it a
- * value of zero. This field value will be determined during the next resolving of
- * time into time fields.
- *
- * @param field The time field to be cleared.
- * @stable ICU 2.6.
- */
- void clear(UCalendarDateFields field);
-
- /**
- * Returns a unique class ID POLYMORPHICALLY. Pure virtual method. 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.
- * <P>
- * Concrete subclasses of Calendar must implement getDynamicClassID() and also a
- * static method and data member:
- *
- * static UClassID getStaticClassID() { return (UClassID)&amp;fgClassID; }
- * static char fgClassID;
- *
- * @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 = 0;
-
- /**
- * Returns the resource key string used for this calendar type.
- * For example, prepending "Eras_" to this string could return "Eras_japanese"
- * or "Eras_gregorian".
- *
- * @returns static string, for example, "gregorian" or "japanese"
- * @internal
- */
- virtual const char * getType() const = 0;
-
-protected:
-
- /**
- * Constructs a Calendar with the default time zone as returned by
- * TimeZone::createInstance(), and the default locale.
- *
- * @param success Indicates the status of Calendar object construction. Returns
- * U_ZERO_ERROR if constructed successfully.
- * @stable ICU 2.0
- */
- Calendar(UErrorCode& success);
-
- /**
- * Copy constructor
- *
- * @param source Calendar object to be copied from
- * @stable ICU 2.0
- */
- Calendar(const Calendar& source);
-
- /**
- * Default assignment operator
- *
- * @param right Calendar object to be copied
- * @stable ICU 2.0
- */
- Calendar& operator=(const Calendar& right);
-
- /**
- * Constructs a Calendar with the given time zone and locale. Clients are no longer
- * responsible for deleting the given time zone object after it's adopted.
- *
- * @param zone The given time zone.
- * @param aLocale The given locale.
- * @param success Indicates the status of Calendar object construction. Returns
- * U_ZERO_ERROR if constructed successfully.
- * @stable ICU 2.0
- */
- Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success);
-
- /**
- * Constructs a Calendar with the given time zone and locale.
- *