ICU 63.1 63.1

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
24 U_NAMESPACE_BEGIN
25
32 class U_I18N_API TimeUnit: public MeasureUnit {
33 public:
38 enum UTimeUnitFields {
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
131 U_NAMESPACE_END
132
133 #endif /* #if !UCONFIG_NO_FORMATTING */
134
135 #endif // __TMUNIT_H__
136 //eof
137 //
icu::MeasureUnit::clone
virtual UObject * clone() const
Returns a polymorphic clone of this object.
icu::TimeUnit::UTimeUnitFields
UTimeUnitFields
Constants for all the time units we supported.
Definition: tmunit.h:38
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:38
icu::MeasureUnit::operator=
MeasureUnit & operator=(const MeasureUnit &other)
Assignment operator.
icu::MeasureUnit::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:90
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
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
icu::TimeUnit
Measurement unit for time units.
Definition: tmunit.h:32
measunit.h
C++ API: A unit for measuring a quantity.
icu::MeasureUnit::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:220