ICU 62.1 62.1
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
25
26
34public:
50
65
66
72
73
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
126
127
139 virtual UClassID getDynamicClassID(void) const;
140
141
147 const TimeUnit& getTimeUnit() const;
148
155};
156
157
158
159inline UBool
160TimeUnitAmount::operator!=(const UObject& other) const {
161 return !operator==(other);
162}
163
165
166#endif /* #if !UCONFIG_NO_FORMATTING */
167
168#endif // __TMUTAMT_H__
169//eof
170//
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition fmtable.h:62
"Smart pointer" base class; do not use directly: use LocalPointer etc.
An amount of a specified unit, consisting of a number and a Unit.
Definition measure.h:43
Express a duration as a time unit and number.
Definition tmutamt.h:33
TimeUnitAmount & operator=(const TimeUnitAmount &other)
Assignment operator.
TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given numeric amount and the given time unit.
const TimeUnit & getTimeUnit() const
Get the time unit.
static UClassID getStaticClassID(void)
Return the class ID for this class.
TimeUnit::UTimeUnitFields getTimeUnitField() const
Get the time unit field value.
TimeUnitAmount(const TimeUnitAmount &other)
Copy constructor.
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
TimeUnitAmount(const Formattable &number, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given number and the given time unit.
virtual ~TimeUnitAmount()
Destructor.
virtual UObject * clone() const
Clone.
virtual UBool operator==(const UObject &other) const
Equality operator.
Measurement unit for time units.
Definition tmunit.h:32
UTimeUnitFields
Constants for all the time units we supported.
Definition tmunit.h:38
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
C++ API: MeasureUnit object.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
C++ API: time unit object.
int8_t UBool
The ICU boolean type.
Definition umachine.h:236
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:93
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:396
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:360
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:138
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:137