ICU 64.2  64.2
tmunit.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-2016, International Business Machines Corporation, *
6  * Google, and others. All Rights Reserved. *
7  *******************************************************************************
8  */
9 
10 #ifndef __TMUNIT_H__
11 #define __TMUNIT_H__
12 
13 
20 #include "unicode/measunit.h"
21 
22 #if !UCONFIG_NO_FORMATTING
23 
25 
33 public:
39  UTIMEUNIT_YEAR,
40  UTIMEUNIT_MONTH,
41  UTIMEUNIT_DAY,
42  UTIMEUNIT_WEEK,
43  UTIMEUNIT_HOUR,
44  UTIMEUNIT_MINUTE,
45  UTIMEUNIT_SECOND,
46 #ifndef U_HIDE_DEPRECATED_API
47 
51  UTIMEUNIT_FIELD_COUNT
52 #endif // U_HIDE_DEPRECATED_API
53  };
54 
65  static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField,
66  UErrorCode& status);
67 
68 
73  virtual UObject* clone() const;
74 
79  TimeUnit(const TimeUnit& other);
80 
85  TimeUnit& operator=(const TimeUnit& other);
86 
95  virtual UClassID getDynamicClassID() const;
96 
103  static UClassID U_EXPORT2 getStaticClassID();
104 
105 
111  UTimeUnitFields getTimeUnitField() const;
112 
117  virtual ~TimeUnit();
118 
119 private:
120  UTimeUnitFields fTimeUnitField;
121 
126  TimeUnit(UTimeUnitFields timeUnitField);
127 
128 };
129 
130 
132 
133 #endif /* #if !UCONFIG_NO_FORMATTING */
134 
135 #endif // __TMUNIT_H__
136 //eof
137 //
virtual UObject * clone() const
Returns a polymorphic clone of this object.
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:38
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:38
MeasureUnit & operator=(const MeasureUnit &other)
Assignment operator.
static UClassID getStaticClassID(void)
Return the class ID for this class.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:93
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
Measurement unit for time units.
Definition: tmunit.h:32
C++ API: A unit for measuring a quantity.
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223