ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

tmutamt.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) 2009-2010, Google, International Business Machines Corporation and *
6 * others. All Rights Reserved. *
7 *******************************************************************************
8 */
9
10 #ifndef __TMUTAMT_H__
11 #define __TMUTAMT_H__
12
13
19 #include "unicode/measure.h"
20 #include "unicode/tmunit.h"
21
22 #if !UCONFIG_NO_FORMATTING
23
24 U_NAMESPACE_BEGIN
25
26
33 class U_I18N_API TimeUnitAmount: public Measure {
34 public:
47 TimeUnitAmount(const Formattable& number,
48 TimeUnit::UTimeUnitFields timeUnitField,
49 UErrorCode& status);
50
63 TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField,
64 UErrorCode& status);
65
66
71 TimeUnitAmount(const TimeUnitAmount& other);
72
73
78 TimeUnitAmount& operator=(const TimeUnitAmount& other);
79
80
86 virtual UObject* clone() const;
87
88
93 virtual ~TimeUnitAmount();
94
95
102 virtual UBool operator==(const UObject& other) const;
103
104
111 UBool operator!=(const UObject& other) const;
112
113
125 static UClassID U_EXPORT2 getStaticClassID(void);
126
127
139 virtual UClassID getDynamicClassID(void) const;
140
141
147 const TimeUnit& getTimeUnit() const;
148
154 TimeUnit::UTimeUnitFields getTimeUnitField() const;
155 };
156
157
158
159 inline UBool
160 TimeUnitAmount::operator!=(const UObject& other) const {
161 return !operator==(other);
162 }
163
164 U_NAMESPACE_END
165
166 #endif /* #if !UCONFIG_NO_FORMATTING */
167
168 #endif // __TMUTAMT_H__
169 //eof
170 //
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:38
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:43
icu::TimeUnitAmount::operator!=
UBool operator!=(const UObject &other) const
Not-equality operator.
Definition: tmutamt.h:160
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:93
tmunit.h
C++ API: time unit object.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:360
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
icu::TimeUnit
Measurement unit for time units.
Definition: tmunit.h:32
icu::Measure::operator==
UBool operator==(const UObject &other) const
Equality operator.
icu::Measure::clone
virtual UObject * clone() const
Return a polymorphic clone of this object.
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
measure.h
C++ API: MeasureUnit object.
icu::Measure::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::TimeUnitAmount
Express a duration as a time unit and number.
Definition: tmutamt.h:33
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
icu::Measure::operator=
Measure & operator=(const Measure &other)
Assignment operator.
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
icu::Measure::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:68
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236