Loading...
Searching...
No Matches
tmutamt.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2009-2010, Google, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
#ifndef __TMUTAMT_H__
#define __TMUTAMT_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/measure.h"
#include "unicode/tmunit.h"
U_NAMESPACE_BEGIN
class U_I18N_API TimeUnitAmount: public Measure {
public:
TimeUnitAmount(const Formattable& number,
TimeUnit::UTimeUnitFields timeUnitField,
UErrorCode& status);
TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField,
UErrorCode& status);
TimeUnitAmount(const TimeUnitAmount& other);
TimeUnitAmount& operator=(const TimeUnitAmount& other);
virtual TimeUnitAmount* clone() const override;
virtual ~TimeUnitAmount();
virtual bool operator==(const UObject& other) const;
bool operator!=(const UObject& other) const;
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const override;
const TimeUnit& getTimeUnit() const;
TimeUnit::UTimeUnitFields getTimeUnitField() const;
};
inline bool
TimeUnitAmount::operator!=(const UObject& other) const {
return !operator==(other);
}
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __TMUTAMT_H__
//eof
//
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition fmtable.h:63
icu::Measure::Measure
Measure(const Formattable &number, MeasureUnit *adoptedUnit, UErrorCode &ec)
Construct an object with the given numeric amount and the given unit.
icu::Measure::operator!=
bool operator!=(const UObject &other) const
Inequality operator.
Definition measure.h:98
icu::TimeUnitAmount::getStaticClassID
static UClassID getStaticClassID()
Return the class ID for this class.
icu::TimeUnitAmount::operator!=
bool operator!=(const UObject &other) const
Not-equality operator.
Definition tmutamt.h:162
icu::TimeUnitAmount::operator=
TimeUnitAmount & operator=(const TimeUnitAmount &other)
Assignment operator.
icu::TimeUnitAmount::TimeUnitAmount
TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField, UErrorCode &status)
Construct TimeUnitAmount object with the given numeric amount and the given time unit.
icu::TimeUnitAmount::getTimeUnit
const TimeUnit & getTimeUnit() const
Get the time unit.
icu::TimeUnitAmount::operator==
virtual bool operator==(const UObject &other) const
Equality operator.
icu::TimeUnitAmount::getTimeUnitField
TimeUnit::UTimeUnitFields getTimeUnitField() const
Get the time unit field value.
icu::TimeUnitAmount::TimeUnitAmount
TimeUnitAmount(const TimeUnitAmount &other)
Copy constructor.
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::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
icu::TimeUnitAmount::~TimeUnitAmount
virtual ~TimeUnitAmount()
Destructor.
icu::TimeUnitAmount::clone
virtual TimeUnitAmount * clone() const override
Clone.
icu::TimeUnit
Measurement unit for time units.
Definition tmunit.h:35
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition tmunit.h:41
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition uobject.h:222
measure.h
C++ API: MeasureUnit object.
tmunit.h
C++ API: time unit object.
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.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:509
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:316