intl/icu/source/common/unicode/dtintrv.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2 *******************************************************************************
     3 * Copyright (C) 2008-2009, International Business Machines Corporation and
     4 * others. All Rights Reserved.
     5 *******************************************************************************
     6 *
     7 * File DTINTRV.H 
     8 *
     9 *******************************************************************************
    10 */
    12 #ifndef __DTINTRV_H__
    13 #define __DTINTRV_H__
    15 #include "unicode/utypes.h"
    16 #include "unicode/uobject.h"
    18 /**
    19  * \file
    20  * \brief C++ API: Date Interval data type
    21  */
    24 U_NAMESPACE_BEGIN
    27 /**
    28  * This class represents a date interval.
    29  * It is a pair of UDate representing from UDate 1 to UDate 2.
    30  * @stable ICU 4.0
    31 **/
    32 class U_COMMON_API DateInterval : public UObject {
    33 public:
    35     /** 
    36      * Construct a DateInterval given a from date and a to date.
    37      * @param fromDate  The from date in date interval.
    38      * @param toDate    The to date in date interval.
    39      * @stable ICU 4.0
    40      */
    41     DateInterval(UDate fromDate, UDate toDate);
    43     /**
    44      * destructor
    45      * @stable ICU 4.0
    46      */
    47     virtual ~DateInterval();
    49     /** 
    50      * Get the from date.
    51      * @return  the from date in dateInterval.
    52      * @stable ICU 4.0
    53      */
    54     UDate getFromDate() const;
    56     /** 
    57      * Get the to date.
    58      * @return  the to date in dateInterval.
    59      * @stable ICU 4.0
    60      */
    61     UDate getToDate() const;
    64     /**
    65      * Return the class ID for this class. This is useful only for comparing to
    66      * a return value from getDynamicClassID(). For example:
    67      * <pre>
    68      * .   Base* polymorphic_pointer = createPolymorphicObject();
    69      * .   if (polymorphic_pointer->getDynamicClassID() ==
    70      * .       erived::getStaticClassID()) ...
    71      * </pre>
    72      * @return          The class ID for all objects of this class.
    73      * @stable ICU 4.0
    74      */
    75     static UClassID U_EXPORT2 getStaticClassID(void);
    77     /**
    78      * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    79      * method is to implement a simple version of RTTI, since not all C++
    80      * compilers support genuine RTTI. Polymorphic operator==() and clone()
    81      * methods call this method.
    82      *
    83      * @return          The class ID for this object. All objects of a
    84      *                  given class have the same class ID.  Objects of
    85      *                  other classes have different class IDs.
    86      * @stable ICU 4.0
    87      */
    88     virtual UClassID getDynamicClassID(void) const;
    91     /**
    92      * Copy constructor.
    93      * @stable ICU 4.0
    94      */
    95     DateInterval(const DateInterval& other);
    97     /**
    98      * Default assignment operator
    99      * @stable ICU 4.0
   100      */
   101     DateInterval& operator=(const DateInterval&);
   103     /**
   104      * Equality operator.
   105      * @return TRUE if the two DateIntervals are the same
   106      * @stable ICU 4.0
   107      */
   108     virtual UBool operator==(const DateInterval& other) const;
   110     /**
   111      * Non-equality operator
   112      * @return TRUE if the two DateIntervals are not the same
   113      * @stable ICU 4.0
   114      */
   115     UBool operator!=(const DateInterval& other) const;
   118     /**
   119      * clone this object. 
   120      * The caller owns the result and should delete it when done.
   121      * @return a cloned DateInterval
   122      * @stable ICU 4.0
   123      */
   124      virtual DateInterval* clone() const;
   126 private:
   127     /** 
   128      * Default constructor, not implemented.
   129      */
   130     DateInterval();
   132     UDate fromDate;
   133     UDate toDate;
   135 } ;// end class DateInterval
   138 inline UDate 
   139 DateInterval::getFromDate() const { 
   140     return fromDate; 
   141 }
   144 inline UDate 
   145 DateInterval::getToDate() const { 
   146     return toDate; 
   147 }
   150 inline UBool 
   151 DateInterval::operator!=(const DateInterval& other) const { 
   152     return ( !operator==(other) );
   153 }
   156 U_NAMESPACE_END
   158 #endif

mercurial