ICU 55.1  55.1
tmutamt.h
Go to the documentation of this file.
1 /*
2  *******************************************************************************
3  * Copyright (C) 2009-2010, Google, International Business Machines Corporation and *
4  * others. All Rights Reserved. *
5  *******************************************************************************
6  */
7 
8 #ifndef __TMUTAMT_H__
9 #define __TMUTAMT_H__
10 
11 
17 #include "unicode/measure.h"
18 #include "unicode/tmunit.h"
19 
20 #if !UCONFIG_NO_FORMATTING
21 
23 
24 
32 public:
45  TimeUnitAmount(const Formattable& number,
46  TimeUnit::UTimeUnitFields timeUnitField,
47  UErrorCode& status);
48 
61  TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField,
62  UErrorCode& status);
63 
64 
70 
71 
77 
78 
84  virtual UObject* clone() const;
85 
86 
91  virtual ~TimeUnitAmount();
92 
93 
100  virtual UBool operator==(const UObject& other) const;
101 
102 
109  UBool operator!=(const UObject& other) const;
110 
111 
123  static UClassID U_EXPORT2 getStaticClassID(void);
124 
125 
137  virtual UClassID getDynamicClassID(void) const;
138 
139 
145  const TimeUnit& getTimeUnit() const;
146 
153 };
154 
155 
156 
157 inline UBool
158 TimeUnitAmount::operator!=(const UObject& other) const {
159  return !operator==(other);
160 }
161 
163 
164 #endif /* #if !UCONFIG_NO_FORMATTING */
165 
166 #endif // __TMUTAMT_H__
167 //eof
168 //
icu::TimeUnitAmount::operator=
TimeUnitAmount & operator=(const TimeUnitAmount &other)
Assignment operator.
icu::TimeUnitAmount::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
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:358
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:66
icu::TimeUnitAmount::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::TimeUnitAmount::~TimeUnitAmount
virtual ~TimeUnitAmount()
Destructor.
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
icu::TimeUnitAmount::TimeUnitAmount
TimeUnitAmount(const TimeUnitAmount &other)
Copy constructor.
icu::TimeUnitAmount::operator==
virtual UBool operator==(const UObject &other) const
Equality operator.
icu::TimeUnitAmount::getTimeUnitField
TimeUnit::UTimeUnitFields getTimeUnitField() const
Get the time unit field value.
icu::TimeUnitAmount::getTimeUnit
const TimeUnit & getTimeUnit() const
Get the time unit.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:91
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:476
icu::TimeUnit
Measurement unit for time units.
Definition: tmunit.h:30
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
icu::TimeUnitAmount::TimeUnitAmount
TimeUnitAmount(const Formattable &number, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given number and the given time unit.
icu::TimeUnitAmount
Express a duration as a time unit and number.
Definition: tmutamt.h:31
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:41
icu::TimeUnitAmount::clone
virtual UObject * clone() const
Clone.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:36
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
icu::TimeUnitAmount::TimeUnitAmount
TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given numeric amount and the given time unit.
measure.h
C++ API: MeasureUnit object.
tmunit.h
C++ API: time unit object.