ICU 50.2 50.2
tmunit.h
Go to the documentation of this file.
1/*
2 *******************************************************************************
3 * Copyright (C) 2009-2010, Google, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
6 */
7
8#ifndef __TMUNIT_H__
9#define __TMUNIT_H__
10
11
16
17
18#include "unicode/measunit.h"
19
20#if !UCONFIG_NO_FORMATTING
21
23
31public:
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
84 virtual UBool operator==(const UObject& other) const;
85
91 UBool operator!=(const UObject& other) const;
92
102
109 static UClassID U_EXPORT2 getStaticClassID();
110
111
118
123 virtual ~TimeUnit();
124
125private:
126 UTimeUnitFields fTimeUnitField;
127
132 TimeUnit(UTimeUnitFields timeUnitField);
133
134};
135
136
137inline UBool
138TimeUnit::operator!=(const UObject& other) const {
139 return !operator==(other);
140}
141
142
144
145#endif /* #if !UCONFIG_NO_FORMATTING */
146
147#endif // __TMUNIT_H__
148//eof
149//
MeasureUnit()
Default constructor.
static UClassID getStaticClassID()
Returns the class ID for this class.
static TimeUnit * createInstance(UTimeUnitFields timeUnitField, UErrorCode &status)
Create Instance.
virtual UClassID getDynamicClassID() const
Returns a unique class ID for this object POLYMORPHICALLY.
virtual ~TimeUnit()
Destructor.
UBool operator!=(const UObject &other) const
Non-Equality operator.
Definition tmunit.h:138
TimeUnit(const TimeUnit &other)
Copy operator.
virtual UObject * clone() const
Override clone.
UTimeUnitFields getTimeUnitField() const
Get time unit field.
UTimeUnitFields
Constants for all the time units we supported.
Definition tmunit.h:36
virtual UBool operator==(const UObject &other) const
Equality operator.
TimeUnit & operator=(const TimeUnit &other)
Assignment operator.
UObject is the common ICU "boilerplate" class.
Definition uobject.h:229
C++ API: A unit for measuring a quantity.
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
int8_t UBool
The ICU boolean type.
Definition umachine.h:200
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:476
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:358
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:130
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:129