ICU 76.1: common/unicode/dtintrv.h Source File

ICU 76.1 76.1

dtintrv.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4*******************************************************************************
5* Copyright (C) 2008-2009, International Business Machines Corporation and
6* others. All Rights Reserved.
7*******************************************************************************
8*
9* File DTINTRV.H
10*
11*******************************************************************************
12*/
13
14#ifndef __DTINTRV_H__
15#define __DTINTRV_H__
16
17#include "unicode/utypes.h"
18
19#if U_SHOW_CPLUSPLUS_API
20
21#include "unicode/uobject.h"
22
28U_NAMESPACE_BEGIN
29
30
36 class U_COMMON_API DateInterval : public UObject {
37public:
38
45 DateInterval(UDate fromDate, UDate toDate);
46
51 virtual ~DateInterval();
52
58 inline UDate getFromDate() const;
59
65 inline UDate getToDate() const;
66
67
79 static UClassID U_EXPORT2 getStaticClassID();
80
92 virtual UClassID getDynamicClassID() const override;
93
98 DateInterval(const DateInterval& other);
99
104 DateInterval& operator=(const DateInterval&);
105
111 virtual bool operator==(const DateInterval& other) const;
112
118 inline bool operator!=(const DateInterval& other) const;
119
120
127 virtual DateInterval* clone() const;
128
129private:
133 DateInterval() = delete;
134
135 UDate fromDate;
136 UDate toDate;
137
138} ;// end class DateInterval
139
140
141inline UDate
142DateInterval::getFromDate() const {
143 return fromDate;
144}
145
146
147inline UDate
148DateInterval::getToDate() const {
149 return toDate;
150}
151
152
153inline bool
154DateInterval::operator!=(const DateInterval& other) const {
155 return ( !operator==(other) );
156}
157
158
159U_NAMESPACE_END
160
161#endif /* U_SHOW_CPLUSPLUS_API */
162
163#endif
icu::DateInterval
This class represents a date interval.
Definition dtintrv.h:36
icu::DateInterval::~DateInterval
virtual ~DateInterval()
destructor
icu::DateInterval::operator==
virtual bool operator==(const DateInterval &other) const
Equality operator.
icu::DateInterval::clone
virtual DateInterval * clone() const
clone this object.
icu::DateInterval::DateInterval
DateInterval(const DateInterval &other)
Copy constructor.
icu::DateInterval::getStaticClassID
static UClassID getStaticClassID()
Return the class ID for this class.
icu::DateInterval::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
icu::DateInterval::operator=
DateInterval & operator=(const DateInterval &)
Default assignment operator.
icu::DateInterval::DateInterval
DateInterval(UDate fromDate, UDate toDate)
Construct a DateInterval given a from date and a to date.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
icu::operator!=
bool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition stringpiece.h:346
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition utypes.h:315
UDate
double UDate
Date and Time data type.
Definition utypes.h:218