ICU 76.1 76.1
Loading...
Searching...
No Matches
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/utypes.h"
20
21#if U_SHOW_CPLUSPLUS_API
22
23#if !UCONFIG_NO_FORMATTING
24
25#include "unicode/measure.h"
26#include "unicode/tmunit.h"
27
28U_NAMESPACE_BEGIN
29
30
38public:
54
69
70
76
77
83
84
90 virtual TimeUnitAmount* clone() const override;
91
92
97 virtual ~TimeUnitAmount();
98
99
106 virtual bool operator==(const UObject& other) const;
107
108
115 bool operator!=(const UObject& other) const;
116
117
130
142 virtual UClassID getDynamicClassID() const override;
143
149 const TimeUnit& getTimeUnit() const;
150
157};
158
159
160
161inline bool
162TimeUnitAmount::operator!=(const UObject& other) const {
163 return !operator==(other);
164}
165
167
168#endif /* #if !UCONFIG_NO_FORMATTING */
169
170#endif /* U_SHOW_CPLUSPLUS_API */
171
172#endif // __TMUTAMT_H__
173//eof
174//
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition fmtable.h:63
"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:45
bool operator!=(const UObject &other) const
Inequality operator.
Definition measure.h:98
Express a duration as a time unit and number.
Definition tmutamt.h:37
static UClassID getStaticClassID()
Return the class ID for this class.
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.
virtual bool operator==(const UObject &other) const
Equality operator.
TimeUnit::UTimeUnitFields getTimeUnitField() const
Get the time unit field value.
TimeUnitAmount(const TimeUnitAmount &other)
Copy constructor.
TimeUnitAmount(const Formattable &number, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given number and the given time unit.
virtual UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
virtual ~TimeUnitAmount()
Destructor.
virtual TimeUnitAmount * clone() const override
Clone.
Measurement unit for time units.
Definition tmunit.h:35
UTimeUnitFields
Constants for all the time units we supported.
Definition tmunit.h:41
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.
C++ API: time unit object.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:430
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:316