tmunit.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-2016, International Business Machines Corporation, *
* Google, and others. All Rights Reserved. *
*******************************************************************************
*/
#ifndef __TMUNIT_H__
#define __TMUNIT_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#include "unicode/measunit.h"
#if !UCONFIG_NO_FORMATTING
U_NAMESPACE_BEGIN
class U_I18N_API TimeUnit: public MeasureUnit {
public:
enum UTimeUnitFields {
UTIMEUNIT_YEAR,
UTIMEUNIT_MONTH,
UTIMEUNIT_DAY,
UTIMEUNIT_WEEK,
UTIMEUNIT_HOUR,
UTIMEUNIT_MINUTE,
UTIMEUNIT_SECOND,
#ifndef U_HIDE_DEPRECATED_API
UTIMEUNIT_FIELD_COUNT
#endif // U_HIDE_DEPRECATED_API
};
static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField,
UErrorCode& status);
virtual TimeUnit* clone() const override;
TimeUnit(const TimeUnit& other);
TimeUnit& operator=(const TimeUnit& other);
virtual UClassID getDynamicClassID() const override;
static UClassID U_EXPORT2 getStaticClassID();
UTimeUnitFields getTimeUnitField() const;
virtual ~TimeUnit();
private:
UTimeUnitFields fTimeUnitField;
TimeUnit(UTimeUnitFields timeUnitField);
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __TMUNIT_H__
//eof
//
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:409
icu::TimeUnit
Measurement unit for time units.
Definition: tmunit.h:35
icu::TimeUnit::operator=
TimeUnit & operator=(const TimeUnit &other)
Assignment operator.
icu::TimeUnit::getStaticClassID
static UClassID getStaticClassID()
Returns the class ID for this class.
icu::TimeUnit::TimeUnit
TimeUnit(const TimeUnit &other)
Copy operator.
icu::TimeUnit::~TimeUnit
virtual ~TimeUnit()
Destructor.
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:41
icu::TimeUnit::getTimeUnitField
UTimeUnitFields getTimeUnitField() const
Get time unit field.
icu::TimeUnit::clone
virtual TimeUnit * clone() const override
Override clone.
icu::TimeUnit::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID for this object POLYMORPHICALLY.
icu::TimeUnit::createInstance
static TimeUnit * createInstance(UTimeUnitFields timeUnitField, UErrorCode &status)
Create Instance.
measunit.h
C++ API: A unit for measuring a quantity.
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:415
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:301