ICU 62.1 62.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
25
33public:
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
51 UTIMEUNIT_FIELD_COUNT
52#endif // U_HIDE_DEPRECATED_API
53 };
54
67
68
73 virtual UObject* clone() const;
74
80
86
95 virtual UClassID getDynamicClassID() const;
96
104
105
112
117 virtual ~TimeUnit();
118
119private:
120 UTimeUnitFields fTimeUnitField;
121
127
128};
129
130
132
133#endif /* #if !UCONFIG_NO_FORMATTING */
134
135#endif // __TMUNIT_H__
136//eof
137//
"Smart pointer" base class; do not use directly: use LocalPointer etc.
A unit such as length, mass, volume, currency, etc.
Definition measunit.h:38
Measurement unit for time units.
Definition tmunit.h:32
static UClassID getStaticClassID()
Returns the class ID for this class.
static TimeUnit * createInstance(UTimeUnitFields timeUnitField, UErrorCode &status)
Create Instance.
TimeUnit(const TimeUnit &other)
Copy operator.
virtual ~TimeUnit()
Destructor.
UTimeUnitFields
Constants for all the time units we supported.
Definition tmunit.h:38
TimeUnit & operator=(const TimeUnit &other)
Assignment operator.
virtual UClassID getDynamicClassID() const
Returns a unique class ID for this object POLYMORPHICALLY.
UTimeUnitFields getTimeUnitField() const
Get time unit field.
virtual UObject * clone() const
Override clone.
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
C++ API: A unit for measuring a quantity.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:93
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:396
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:360
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:138
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:137