ICU 57.1  57.1
tmunit.h
Go to the documentation of this file.
1 /*
2  *******************************************************************************
3  * Copyright (C) 2009-2016, International Business Machines Corporation, *
4  * Google, and others. All Rights Reserved. *
5  *******************************************************************************
6  */
7 
8 #ifndef __TMUNIT_H__
9 #define __TMUNIT_H__
10 
11 
18 #include "unicode/measunit.h"
19 
20 #if !UCONFIG_NO_FORMATTING
21 
23 
31 public:
37  UTIMEUNIT_YEAR,
38  UTIMEUNIT_MONTH,
39  UTIMEUNIT_DAY,
40  UTIMEUNIT_WEEK,
41  UTIMEUNIT_HOUR,
42  UTIMEUNIT_MINUTE,
43  UTIMEUNIT_SECOND,
44  UTIMEUNIT_FIELD_COUNT
45  };
46 
57  static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField,
58  UErrorCode& status);
59 
60 
65  virtual UObject* clone() const;
66 
71  TimeUnit(const TimeUnit& other);
72 
77  TimeUnit& operator=(const TimeUnit& other);
78 
87  virtual UClassID getDynamicClassID() const;
88 
95  static UClassID U_EXPORT2 getStaticClassID();
96 
97 
103  UTimeUnitFields getTimeUnitField() const;
104 
109  virtual ~TimeUnit();
110 
111 private:
112  UTimeUnitFields fTimeUnitField;
113 
118  TimeUnit(UTimeUnitFields timeUnitField);
119 
120 };
121 
122 
124 
125 #endif /* #if !UCONFIG_NO_FORMATTING */
126 
127 #endif // __TMUNIT_H__
128 //eof
129 //
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:36
U_I18N_API
#define U_I18N_API
Definition: utypes.h:358
icu::MeasureUnit::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
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::MeasureUnit::operator=
MeasureUnit & operator=(const MeasureUnit &other)
Assignment operator.
icu::MeasureUnit::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::MeasureUnit::clone
virtual UObject * clone() const
Returns a polymorphic clone of this object.
U_NAMESPACE_END
#define U_NAMESPACE_END
Definition: uversion.h:130
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:36
measunit.h
C++ API: A unit for measuring a quantity.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
Definition: uversion.h:129